# Copyright 2026 The JAX Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Package for Pallas GPU Interpret Mode load("//jaxlib:jax.bzl", "py_deps", "pytype_strict_library") package( default_applicable_licenses = [], default_visibility = [ "//jax:internal", ], ) pytype_strict_library( name = "params", srcs = ["params.py"], deps = [ "//jax", "//jax/_src:callback", "//jax/_src:config", "//jax/_src:effects", "//jax/_src/pallas/mosaic/interpret:params", ] + py_deps("numpy"), ) pytype_strict_library( name = "interpret_pallas_call", srcs = [ "__init__.py", "interpret_pallas_call.py", ], deps = [ ":gpu_callbacks", ":jaxpr_interpret", ":params", ":race_detection_state", ":shared_memory", "//jax", "//jax/_src:callback", "//jax/_src:core", "//jax/_src:lax", "//jax/_src:typing", "//jax/_src:util", "//jax/_src/pallas", "//jax/_src/pallas/mosaic/interpret:thread_map", "//jax/_src/pallas/mosaic/interpret:utils", "//jax/_src/pallas/mosaic_gpu:core", ], ) pytype_strict_library( name = "gpu_callbacks", srcs = ["gpu_callbacks.py"], deps = [ ":params", ":race_detection_state", ":shared_memory", "//jax", "//jax/_src:callback", "//jax/_src:lax", "//jax/_src:source_info_util", "//jax/_src/pallas", "//jax/_src/pallas/mosaic/interpret:params", "//jax/_src/pallas/mosaic/interpret:race_detection_state", "//jax/_src/pallas/mosaic/interpret:thread_map", "//jax/_src/pallas/mosaic/interpret:utils", "//jax/_src/pallas/mosaic/interpret:vector_clock", "//jax/_src/pallas/mosaic_gpu:core", "//jax/_src/pallas/mosaic_gpu:primitives", "//jax/experimental:mosaic_gpu", ] + py_deps([ "numpy", ]), ) pytype_strict_library( name = "jaxpr_interpret", srcs = ["jaxpr_interpret.py"], deps = [ ":gpu_callbacks", ":params", ":shared_memory", "//jax", "//jax/_src:callback", "//jax/_src:core", "//jax/_src:lax", "//jax/_src:source_info_util", "//jax/_src:util", "//jax/_src/pallas", "//jax/_src/pallas/mosaic/interpret:thread_map", "//jax/_src/pallas/mosaic/interpret:utils", "//jax/_src/pallas/mosaic_gpu:core", "//jax/_src/pallas/mosaic_gpu:primitives", ], ) pytype_strict_library( name = "race_detection_state", srcs = ["race_detection_state.py"], deps = [ ":shared_memory", "//jax/_src:source_info_util", "//jax/_src/pallas/mosaic/interpret:race_detection_state", "//jax/_src/pallas/mosaic/interpret:utils", ], ) pytype_strict_library( name = "shared_memory", srcs = ["shared_memory.py"], deps = [ ":params", "//jax", "//jax/_src:core", "//jax/_src:source_info_util", "//jax/_src/pallas", "//jax/_src/pallas/mosaic/interpret:shared_memory", "//jax/_src/pallas/mosaic/interpret:utils", "//jax/_src/pallas/mosaic/interpret:vector_clock", "//jax/_src/pallas/mosaic_gpu:core", ] + py_deps([ "numpy", ]), )