Metadata-Version: 2.4
Name: tokenspeed-deepjit
Version: 0.1.0
Summary: Python packaging for the header-only DeepJIT C++ library.
Author: TokenSpeed maintainers
Project-URL: Homepage, https://github.com/deepseek-ai/DeepJIT
Project-URL: Source, https://github.com/deepseek-ai/DeepJIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: C++
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# tokenspeed-deepjit

Python packaging for the header-only
[deepseek-ai/DeepJIT](https://github.com/deepseek-ai/DeepJIT) C++20 library.
The `tokenspeed-deepjit` distribution vendors the headers from upstream commit
[`8b3ef868705a3792cc1a14ab570b539f72fd3d94`](https://github.com/deepseek-ai/DeepJIT/commit/8b3ef868705a3792cc1a14ab570b539f72fd3d94)
and provides Python and CMake helpers for locating them.

## Installation

```bash
pip install tokenspeed-deepjit
```

The wheel is platform-independent because DeepJIT is header-only. Applications
still need the device toolchain and libraries required by the selected backend.
CUDA consumers need CUDA headers 12.4 or newer, NVCC 12.9 or newer, and PyTorch
with CUDA support. Ascend consumers need the CANN compiler and headers, ACL, and
`torch_npu`. Pybind11 is also required when exposing DeepJIT through a Python
extension.

## Python helpers

```python
import tokenspeed_deepjit

print(tokenspeed_deepjit.include_dir())
print(tokenspeed_deepjit.cmake_prefix_path())
```

The distribution does not install a `deep_jit` Python import package. The
upstream import package is empty; omitting it avoids conflicts with extensions
that embed DeepJIT.

## CMake usage

```cmake
find_package(Python COMPONENTS Interpreter REQUIRED)
execute_process(
  COMMAND "${Python_EXECUTABLE}" -c
          "import tokenspeed_deepjit; print(tokenspeed_deepjit.cmake_prefix_path())"
  OUTPUT_VARIABLE tokenspeed_deepjit_ROOT
  OUTPUT_STRIP_TRAILING_WHITESPACE
  COMMAND_ERROR_IS_FATAL ANY
)

list(PREPEND CMAKE_PREFIX_PATH "${tokenspeed_deepjit_ROOT}")
find_package(deep_jit CONFIG REQUIRED)
target_link_libraries(my_target PRIVATE deep_jit::deep_jit)
```

The imported target requests C++20 for C++ sources. CUDA projects must also set
`CUDA_STANDARD 20` or pass the equivalent standard flag to NVCC.

## Local build

Populate the upstream headers before building:

```bash
git clone https://github.com/deepseek-ai/DeepJIT.git /tmp/DeepJIT
git -C /tmp/DeepJIT checkout 8b3ef868705a3792cc1a14ab570b539f72fd3d94
./prepare_headers.sh /tmp/DeepJIT
python -m build
```

See the [upstream documentation](https://github.com/deepseek-ai/DeepJIT) for
the runtime API and backend integration details.
