loopyt d393584592 fix(triton): explicit strides, negative-index guards, and an honest status
Three fixes found by running the ported kernels inside the engine rather than only against the
A/B harness:

`map_lookup` took the row stride from the row width, which is wrong for the views the engine
passes (a slice of a wider buffer). Every kernel now takes its strides as arguments.

`expand_sampling_params` used `row_to_req` directly as an offset; padding rows carry a negative
request index, so that read out of bounds. It is part of the mask now, and `store_mtp_info` treats
a non-positive slot as "no write" for the same reason.

`prepare_verification_metadata` computed its grid from `seqlen_q.max().item()`, a device-to-host
read that the engine rejects inside the forward ("called a synchronizing CUDA operation"). The
grid now comes from the factory's `num_steps`.

Integration is not finished, and `H20-TRITON-PLAN.md` says so plainly: with
`DEEPINFER_OPS_BACKEND=triton` the engine runs the 15 ported kernels into the sampling phase and
then faults on an illegal access inside `expand_sampling_params_tl`, even though that kernel is
element-for-element identical to the baseline in its own A/B cases, and even though the negative
index, the reserved slot and uint64 seeds have all been ruled out. The note records the two
bisection steps worth trying next, the env-var tooling already in place, and the fact that one of
my own edits silently did nothing because the search string carried a trailing space.

Also records the two new Triton traps: an `other=` literal must match the destination dtype, and a
grid must never be derived from a device read.
2026-10-22 01:02:08 +08:00
..
_C initial commit 2026-10-20 12:09:42 +08:00
distributed initial commit 2026-10-20 12:09:42 +08:00
engine initial commit 2026-10-20 12:09:42 +08:00
entrypoints initial commit 2026-10-20 12:09:42 +08:00
h20_ops fix(debug): move debug_dump out of h20_ops so other platforms can import it 2026-10-21 22:37:49 +08:00
hugging_face style(sm90): satisfy ruff and add the missing type annotations 2026-10-21 17:09:08 +08:00
model_executor fix(triton): explicit strides, negative-index guards, and an honest status 2026-10-22 01:02:08 +08:00
npu_ops feat: add SM90 (Hopper) support for DeepSeek-V4.1 inference 2026-10-21 15:18:56 +08:00
structure_output initial commit 2026-10-20 12:09:42 +08:00
ve initial commit 2026-10-20 12:09:42 +08:00
worker fix(debug): move debug_dump out of h20_ops so other platforms can import it 2026-10-21 22:37:49 +08:00
__init__.py initial commit 2026-10-20 12:09:42 +08:00
attrdict.py initial commit 2026-10-20 12:09:42 +08:00
config.py initial commit 2026-10-20 12:09:42 +08:00
debug_dump.py fix(debug): move debug_dump out of h20_ops so other platforms can import it 2026-10-21 22:37:49 +08:00
environ.py initial commit 2026-10-20 12:09:42 +08:00
load_class.py initial commit 2026-10-20 12:09:42 +08:00
logger.py initial commit 2026-10-20 12:09:42 +08:00
model_config_loader.py initial commit 2026-10-20 12:09:42 +08:00
multimodal_tokens.py initial commit 2026-10-20 12:09:42 +08:00
platform.py feat: add SM90 (Hopper) support for DeepSeek-V4.1 inference 2026-10-21 15:18:56 +08:00
py.typed initial commit 2026-10-20 12:09:42 +08:00
sampling_params.py initial commit 2026-10-20 12:09:42 +08:00
sequence.py initial commit 2026-10-20 12:09:42 +08:00
shared_memory.py initial commit 2026-10-20 12:09:42 +08:00
testing.py initial commit 2026-10-20 12:09:42 +08:00
timer.py initial commit 2026-10-20 12:09:42 +08:00
utils.py initial commit 2026-10-20 12:09:42 +08:00