Skip to content
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

[sharktank] Add test for sharded rotary table #274

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

rsuderman
Copy link
Contributor

We should be able to validate the sharded rotary table via comparison with the unsharded version. This runs the sharded and unsharded implementations, asserting near identical results.

We should be able to validate the sharded rotary table via comparison
with the unsharded version. This runs the sharded and unsharded
implementations, asserting near identical results.
rope_freq_base = None

# First we setup and get the default rotary embedding layer
xq = torch.rand((bs, max_seqlen, heads, rope_dims), dtype=torch.float)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may seed the torch RNG to make sure we get deterministic test results.

@rsuderman rsuderman merged commit 3015ec7 into nod-ai:main Oct 11, 2024
8 checks passed
@rsuderman rsuderman deleted the sharded_rotary_test branch October 11, 2024 21:41
monorimet pushed a commit that referenced this pull request Oct 16, 2024
We should be able to validate the sharded rotary table via comparison
with the unsharded version. This runs the sharded and unsharded
implementations, asserting near identical results.
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.

2 participants