Skip to content

tools(dsv41): the kit rebuild's jit table sees the family's namespace subpackage (aot_pack died on the drafter's _bias) - #14

Merged
bertholomus merged 2 commits into
deepseek-v41-zigfrom
fix/jit-table-namespace-cuda
Oct 12, 2026
Merged

bertholomus merged 2 commits into
deepseek-v41-zigfrom
fix/jit-table-namespace-cuda

Conversation

@bertholomus

Copy link
Copy Markdown
Owner

Root cause

zrec_fixtures.py's jit_table() collected its modules with pkgutil.walk_packages, which reports a subpackage only when the directory has an __init__.py. The family's cuda/ has none (PEP 420 namespace package), so the walk never entered it: jit.json got only the modules zrec_fixtures.py itself imports (kernels.py through model.py) and missed every other engine module — markov.py first of all (the drafter's _bias, _score, _finish, _pick). The first recorded launch in those modules then killed aot_pack.py with a bare KeyError (recipe issue #15's cuda.markov._bias mapping error). Verified on a CPU-only container: the unpatched table has 0 markov keys while import tensorfold.families.deepseek_v41.cuda.markov succeeds.

Fix

  • jit_table() imports the two prefixes' modules from disk (os.walk over each base's __path__, same set the walk covered plus the namespace dirs) and fails loudly, naming the module, when one cannot be imported — a silently incomplete table is what made the crash cryptic.
  • aot_pack.py names the missing function and the fix instead of raising a bare KeyError.

Receipt (CPU-only, python:3.12-slim, torch 2.14.1+cpu, triton 3.7.1, the deepseek-v41-tp2 package)

  • Old table: 0 markov keys; aot_pack.py on a _bias recording fixture exits KeyError: 'tensorfold.families.deepseek_v41.cuda.markov._bias'.
  • New table: 6 markov keys with _bias's do_not_specialize = [t_stride, o_row, n_rows, n_cols, seg0] from the real source.
  • End to end: triton_aot_manifest.py build + the new aot_pack.py on a synthetic _bias recording produces an aot.json entry equal to the shipped v0.6.1 kit's _bias entry (same hash 1d5c14f5, params, div16/nospec flags, consts, shared, pdl).
  • zig build test: 19/19 steps on this branch (Zig 0.17.0, x86_64, no GPU).

Not run (needs two GB10s): a real recording packed end to end; the packed cubins are the recording's own, so the packing logic is what this changes — a rebuild on real hardware is the last confirmation.

…kage from disk (cuda/ has no __init__.py, so pkgutil skipped its markov.py and aot_pack died on the first recorded launch there)
@bertholomus
bertholomus merged commit dfc8fe5 into deepseek-v41-zig Oct 12, 2026
bertholomus added a commit that referenced this pull request Oct 24, 2026
… subpackage (#14)

TensorFold #14 on this line. pkgutil.walk_packages misses a subpackage without __init__.py, and the family's cuda/
is one: its markov.py (the drafter's _bias, _score, ...) never reached the jit table, and aot_pack.py died on the
first recorded launch there. zrec_fixtures.py now imports the two prefixes' modules from disk, and aot_pack.py names
a function the table lacks. This line keeps aot_pack.py at tools/dsv41-zig/kit/ (TensorFold 1.0.2's copy, which
1.0.12 moved); the change is #14's, line for line.

(cherry picked from commit dfc8fe5, with aot_pack.py's path moved)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
bertholomus added a commit that referenced this pull request Oct 24, 2026
….7.1)

The README's fork note: v0.7.0's nine changes on the four-node branch's v0.3.1, then v0.7.1's seven (the shared DSML
reader and the streamed-prose fix with #25's tests, TF_DS_PROMPT_ALIAS, the stopped-rank watch, the GPU-context
stop, #14 and the test addresses), the merge of the four-node branch's v0.3.2 and the fix that keeps cache_salt on
compaction notes; the two-node recipe's pool of 2,097,152 positions and its v0.7.1. NOTICE names v0.3.2's cache_salt
and the DSML reader with their tests among the new files and compact_test.zig among the changed ones, and
ATTRIBUTION.md's #25 row names the two commits that carry #25's tests. ATTRIBUTION.md adds two reports, @den13501's
(two-node recipe issue #15: the kit rebuild's mapping error, which #14 fixes) and @plyldavid-maker's (issue #25: the
ranks that waited on each other), and says what the export changed in v0.7.1's messages.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant