Skip to content

Clean up splash attention imports#4606

Open
huytransformer wants to merge 1 commit into
AI-Hypercomputer:mainfrom
huytransformer:htn/splash-import-cleanup
Open

Clean up splash attention imports#4606
huytransformer wants to merge 1 commit into
AI-Hypercomputer:mainfrom
huytransformer:htn/splash-import-cleanup

Conversation

@huytransformer

Copy link
Copy Markdown
Collaborator

Description

The general splash attention path now imports from the tokamax dependency while the ring attention keeps the adapted kernels in kernels/tokamax_splash_attention via tokamax_ring_attention.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

Import the general splash attention path from the tokamax dependency;
the ring path keeps the adapted kernels via tokamax_ring_attention.
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

from tokamax._src.ops.attention import base as tokamax_attention_base
from tokamax._src.ops.attention import pallas_triton as tokamax_pallas_triton
from tokamax._src.ops.experimental.tpu.splash_attention import splash_attention_kernel as tokamax_splash_kernel
from tokamax._src.ops.experimental.tpu.splash_attention import splash_attention_mask as tokamax_splash_mask

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would expect an if-else path, e.g. if using ring attention we take forked splash otherwise tokamax path. If the changes are simple like this, why we need to fork all files from tokamax at the beginning?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ring never needed this, it uses the tokamax_ring_attention. These were originally intended for consistency of splash paths

@huytransformer
huytransformer marked this pull request as ready for review July 24, 2026 22:35
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants