2022-10-25 07:23:07 -07:00
|
|
|
# Copyright 2018 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.
|
|
|
|
|
|
|
|
# Shared CUDA/ROCM GPU kernels.
|
|
|
|
|
2024-09-05 18:41:53 -07:00
|
|
|
load(
|
|
|
|
"//jaxlib:jax.bzl",
|
|
|
|
"cc_proto_library",
|
|
|
|
"jax_visibility",
|
|
|
|
"xla_py_proto_library",
|
|
|
|
)
|
2024-11-25 08:29:19 -08:00
|
|
|
# Placeholder: load proto_library
|
2023-06-22 04:56:43 -07:00
|
|
|
|
2022-10-25 07:23:07 -07:00
|
|
|
licenses(["notice"])
|
|
|
|
|
2023-04-19 13:26:24 -07:00
|
|
|
package(
|
|
|
|
default_applicable_licenses = [],
|
2024-08-26 09:10:26 -07:00
|
|
|
default_visibility = ["//jax:internal"],
|
2023-04-19 13:26:24 -07:00
|
|
|
)
|
2022-10-25 07:23:07 -07:00
|
|
|
|
|
|
|
exports_files(srcs = [
|
|
|
|
"blas.cc",
|
2024-08-01 12:27:46 -07:00
|
|
|
"blas_handle_pool.cc",
|
|
|
|
"blas_handle_pool.h",
|
2022-10-25 07:23:07 -07:00
|
|
|
"blas_kernels.cc",
|
|
|
|
"blas_kernels.h",
|
2025-02-06 11:45:14 -08:00
|
|
|
"ffi_wrapper.h",
|
2022-10-25 07:23:07 -07:00
|
|
|
"gpu_kernel_helpers.cc",
|
|
|
|
"gpu_kernel_helpers.h",
|
|
|
|
"gpu_kernels.cc",
|
2024-11-18 08:11:04 -08:00
|
|
|
"hybrid.cc",
|
|
|
|
"hybrid_kernels.cc",
|
|
|
|
"hybrid_kernels.h",
|
2022-10-25 07:23:07 -07:00
|
|
|
"linalg.cc",
|
2024-07-10 12:08:30 -07:00
|
|
|
"linalg_kernels.cc",
|
|
|
|
"linalg_kernels.cu.cc",
|
|
|
|
"linalg_kernels.h",
|
2024-08-16 04:36:30 -07:00
|
|
|
"make_batch_pointers.cu.cc",
|
|
|
|
"make_batch_pointers.h",
|
2022-10-25 07:23:07 -07:00
|
|
|
"prng.cc",
|
|
|
|
"prng_kernels.cc",
|
|
|
|
"prng_kernels.cu.cc",
|
|
|
|
"prng_kernels.h",
|
2022-11-28 14:31:10 -08:00
|
|
|
"rnn.cc",
|
|
|
|
"rnn_kernels.cc",
|
|
|
|
"rnn_kernels.h",
|
2022-10-25 07:23:07 -07:00
|
|
|
"solver.cc",
|
2024-08-01 12:27:46 -07:00
|
|
|
"solver_handle_pool.cc",
|
|
|
|
"solver_handle_pool.h",
|
2024-09-12 07:11:01 -07:00
|
|
|
"solver_interface.cc",
|
|
|
|
"solver_interface.h",
|
2022-10-25 07:23:07 -07:00
|
|
|
"solver_kernels.cc",
|
|
|
|
"solver_kernels.h",
|
2024-08-01 15:01:48 -07:00
|
|
|
"solver_kernels_ffi.cc",
|
|
|
|
"solver_kernels_ffi.h",
|
2022-10-25 07:23:07 -07:00
|
|
|
"sparse.cc",
|
|
|
|
"sparse_kernels.cc",
|
|
|
|
"sparse_kernels.h",
|
2023-05-24 12:09:57 -07:00
|
|
|
"triton.cc",
|
2023-07-03 06:51:45 -07:00
|
|
|
"triton_kernels.cc",
|
|
|
|
"triton_kernels.h",
|
2023-08-16 02:53:05 -07:00
|
|
|
"triton_utils.cc",
|
|
|
|
"triton_utils.h",
|
2022-10-25 07:23:07 -07:00
|
|
|
"vendor.h",
|
|
|
|
])
|
2023-06-22 04:56:43 -07:00
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "triton_proto",
|
|
|
|
srcs = ["triton.proto"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_proto_library(
|
|
|
|
name = "triton_cc_proto",
|
|
|
|
deps = [":triton_proto"],
|
|
|
|
)
|
2024-09-05 18:41:53 -07:00
|
|
|
|
|
|
|
xla_py_proto_library(
|
|
|
|
name = "triton_py_pb2",
|
|
|
|
visibility = jax_visibility("triton_proto_py_users"),
|
|
|
|
deps = [":triton_proto"],
|
|
|
|
)
|
2025-03-18 16:28:00 -07:00
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "gpu_plugin_extension",
|
|
|
|
srcs = ["gpu_plugin_extension.cc"],
|
|
|
|
hdrs = ["gpu_plugin_extension.h"],
|
|
|
|
copts = [
|
|
|
|
"-fexceptions",
|
|
|
|
"-fno-strict-aliasing",
|
|
|
|
],
|
|
|
|
features = ["-use_header_modules"],
|
|
|
|
deps = [
|
|
|
|
"//jaxlib:kernel_nanobind_helpers",
|
|
|
|
"@com_google_absl//absl/status",
|
|
|
|
"@com_google_absl//absl/status:statusor",
|
|
|
|
"@com_google_absl//absl/strings:str_format",
|
|
|
|
"@com_google_absl//absl/strings:string_view",
|
|
|
|
"@nanobind",
|
|
|
|
"@xla//xla:util",
|
|
|
|
"@xla//xla/ffi/api:c_api",
|
|
|
|
"@xla//xla/pjrt:status_casters",
|
|
|
|
"@xla//xla/pjrt/c:pjrt_c_api_ffi_extension_hdrs",
|
|
|
|
"@xla//xla/pjrt/c:pjrt_c_api_gpu_extension_hdrs",
|
|
|
|
"@xla//xla/pjrt/c:pjrt_c_api_hdrs",
|
|
|
|
"@xla//xla/pjrt/c:pjrt_c_api_helpers",
|
|
|
|
"@xla//xla/pjrt/c:pjrt_c_api_triton_extension_hdrs",
|
|
|
|
"@xla//xla/python:py_client_gpu",
|
|
|
|
"@xla//xla/tsl/python/lib/core:numpy",
|
|
|
|
],
|
|
|
|
)
|