DeepInfer/pyproject.toml
loopyt 4a5606ad2d feat(ops): add a selectable Triton backend, and measure the real kernel surface
Groundwork for replacing TileLang with Triton on the H20 path, plus the first ported kernel.

The scope is measured rather than guessed. `DEEPINFER_TRACE_KERNELS=<path>` proxies every `*_tl`
factory in the dispatcher and records its first use; one full text-generation run on 8xH20 says
exactly 24 kernels execute. `H20-TRITON-PLAN.md` lists them, in dependency order.

`DEEPINFER_OPS_BACKEND` selects the backend package (unset keeps the platform default, so nothing
changes by omission) and `DEEPINFER_OPS_FALLBACK` names individual kernels that must stay on the
default. Kernels the selected backend does not export at all are taken from the default with a
one-line notice, which lets a partial port run end to end the whole way through instead of only
at the end.

That coexistence is the reason for a parallel backend rather than an in-place rewrite: the
TileLang kernel is a validated baseline, so each Triton kernel can be diffed against it on real
shapes through the same public interface function, which is a much stronger check than comparing
against a fresh Python reference. `scripts/h20_ops_ab.py` does that swap and reports per case.

First kernel: `gather_tl`, all 9 cases bitwise identical (zeros filled for out-of-range indices,
int8/bfloat16 payloads, strided rows, int32/int64 indices, empty and single-row inputs).
2026-10-22 00:04:27 +08:00

89 lines
2.6 KiB
TOML

[build-system]
requires = [
"ninja",
"setuptools >= 77.0.3",
"torch >= 2.7",
]
build-backend = "setuptools.build_meta"
[project]
name = "deepinfer"
version = "0.1.0"
description = "DeepInfer: High-performance, large-scale inference framework for DeepSeek models"
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.12"
authors = [{ name = "DeepSeek-AI" }]
keywords = ["llm", "inference", "deepseek", "cuda", "ascend"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dynamic = ["dependencies"]
urls = { Repository = "https://github.com/deepseek-ai/deepinfer", Issues = "https://github.com/deepseek-ai/deepinfer/issues" }
[tool.pytest.ini_options]
# Use importlib import mode so that collecting test files inside the deepinfer
# package (e.g. deepinfer/model_executor/layers/tilelang_ops/*.py) does NOT
# trigger the package __init__.py chain (which imports heavy deps like
# deep_gemm).
addopts = ["--import-mode=importlib"]
testpaths = ["tests"]
markers = [
"ci: core tests that run on every CI pipeline",
"ci_npu: core tests that run on the NPU/Ascend CI pipeline",
"benchmark: performance tests selected by benchmark jobs",
"long_context: long-input/output decode PPL regression",
"gpu: unit tests requiring a working GPU",
]
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
# type hint
"ANN",
# disallow specific packages
"TID251",
]
ignore = [
# missing return type for private function; dynamically typed Any
"ANN202", "ANN401",
# star imports
"F405", "F403",
# lambda expression assignment
"E731",
# f-string without any placeholders
"F541",
# line too long, handled by black formatting
"E501",
# module level import not at top of file
"E402",
# function definition does not bind loop variable
"B023",
]
[tool.ruff.lint.per-file-ignores]
# Triton kernel bodies: parameters are pointers and scalars that Triton itself types, and the
# kernels are launched through `kernel[grid](...)` rather than called directly, so the usual
# signature annotations would be either wrong or rejected by the JIT.
"deepinfer/model_executor/layers/tilelang_ops/triton/*.py" = ["ANN001", "ANN201", "ANN202"]
[tool.ruff]
line-length = 140
include = ["./**/*.py"]
extend-exclude = ["vendor"]