generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 32
Batch invariance #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jlonge4
wants to merge
18
commits into
aws-neuron:main
Choose a base branch
from
jlonge4:batch-invariance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Batch invariance #105
Conversation
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
Refactor tests for batch invariance and variance in RMSNorm and MatMul. Now follows the same testing pattern as Thinking Machines Labs.
Added ISA kernel
Added tests for matmul kernel correctness and batch variance effects. Updated existing tests to improve clarity and structure.
Updated RMSNorm kernel to demonstrate batch variance with split reduction along the hidden dimension. Adjusted tile sizes based on batch invariance parameter to illustrate the impact on floating-point addition order during reduction.
Refactor RMSNorm kernel tto replace nl.arange with nl.mgrid
Replaced direct load/store operations with nisa.dma_copy for better performance.
Using DMA copy for improved performance.
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.
Issue #, if available:
N/A
Description of changes:
Demonstrates batch invariance behavior in NKI by replicating findings from Thinking Machines' "Defeating Nondeterminism in LLM Inference".
Key findings:
nki.langkernels (MatMul, RMSNorm) show batch variance in both float32 and bfloat16 when using dynamic reduction strategiesnki.isaoperations show variance in float32 but no variance in bfloat16, making them more suitable for deterministic inferenceContents:
Testing:
Please see detailed unit test requirements in the CONTRIBUTING.md
nki.baremetalnki.benchmarkPull Request Checklist