nki(vector_add): NKI (Trainium) implementation - #306
Open
bowencui123 wants to merge 7 commits into
Open
bowencui123 wants to merge 7 commits into
bowencui123 wants to merge 7 commits into
Conversation
Split out of the consolidated NKI branch cecilia/feature/nki-vector-add (nki-all-operators, PR #259) so each operator can be reviewed on its own. - includes `NkiAutotuner` wiring (search space over the kernel's tile/loop parameter; defaults unchanged) Co-Authored-By: Cecilia123li <68335867+Cecilia123li@users.noreply.github.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Q38kGmXvyoeM1qtCbheSL
Cecilia123li
force-pushed
the
bowen/nki/vector_add
branch
from
August 31, 2026 16:02
6ff6233 to
9f13bc1
Compare
Merges NKI backend timing into results/csv/vector_add_default.csv, run against this branch's impl_nki.py on trn2.3xlarge with the LNC2 execution contract (NEURON_LOGICAL_NC_CONFIG=2, NEURON_RT_NUM_CORES=1, NEURON_CC_FLAGS="--target trn2 --lnc 2"). All cases pass correctness verification. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AQseF7nyesBh8KZAp8g7Cm
bowencui123
commented
Sep 12, 2026
…large, LNC2) Merges fresh NKI backend timing into results/csv/vector_add_default.csv and results/csv/vector_add_autotune.csv via --tile-language nki, which uses the _merge_into_csv path and touches 0 frozen rows -- the existing torch/triton/ cutile/tilelang columns (from GPU runs) are untouched; only torch_nki_ms/ nki_ms/speedup_nki are added/refreshed. All 80 cases pass correctness verification, both runs. Preceded by merging origin/main (26 commits, mostly other operators' TileLang implementations plus the NKI timing-infra rewrite this branch already had via an earlier main merge). Along the way, found and fixed a real environment bug: tilebench_env's islpy had drifted to 2026.2.1 (an unpinned transitive dep of neuronx-cc), incompatible with the installed compiler -- it broke *every* compilation involving elementwise add (reproduced with a bare torch.add, unrelated to NKI or this operator). Every other Neuron venv on the host pins islpy==2026.1; downgraded tilebench_env to match and cleared the stale compile cache. Not committed to requirements.txt here pending discussion. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014skQtQhXSt4Sy4o5eBZ4RL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NKI (AWS Trainium) implementation of vector_add, split out of the consolidated NKI branch
cecilia/feature/nki-vector-add(nki-all-operators, #259) so each operator can be reviewed independently.Files: A benchmarks/operators/vector_add/impl_nki.py
Status: verified on trn2 (default + autotune; NKI 0.063 ms @ n=1M fp16)
NkiAutotunerwiring (search space over the kernel's tile/loop parameter; defaults unchanged)Implementation by @Cecilia123li. Timing/identity infrastructure: #261; Trainium peak/roofline infra: #262.
🤖 Generated with Claude Code
https://claude.ai/code/session_012Q38kGmXvyoeM1qtCbheSL
Autotune (already on this branch)
block_size(free-dim tile per 128-partition block)BLOCK_SIZEautotune=Falsekeeps the previous constants. Validation on trn2, case 0: