Skip to content

Disable sam_fast custom flash without Triton block pointers - #2701

Open
warrendeng wants to merge 1 commit into
mainfrom
warrendeng/sam-fast-disable-flash-without-blockptr
Open

Disable sam_fast custom flash without Triton block pointers#2701
warrendeng wants to merge 1 commit into
mainfrom
warrendeng/sam-fast-disable-flash-without-blockptr

Conversation

@warrendeng

@warrendeng warrendeng commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

The optional segment-anything-fast flash_4 kernel still uses Triton's legacy tl.make_block_ptr and tl.advance APIs, which were removed by triton-lang/triton#10833. This causes the full sam_fast TorchBench model to fail during eager validation with newer Triton revisions.

Detect those APIs before importing segment_anything_fast and disable the kernel with SEGMENT_ANYTHING_FAST_USE_FLASH_4=0 when they are unavailable. On Triton 3.9+, the benchmark continues exercising the full model through its existing SDPA fallback, while older Triton behavior remains unchanged.

Test plan:

  • python3.12 -m py_compile torchbenchmark/models/sam_fast/__init__.py
  • Verified with Triton 3.7 that the custom kernel remains enabled when both APIs exist
  • Simulated missing tl.advance and verified the adapter disables the custom kernel before package import

@warrendeng
warrendeng force-pushed the warrendeng/sam-fast-disable-flash-without-blockptr branch from 64f5141 to 0bdae05 Compare August 19, 2026 20:00
@warrendeng
warrendeng requested a review from atalman August 19, 2026 20:02
@warrendeng
warrendeng marked this pull request as ready for review August 19, 2026 20:38
@warrendeng

warrendeng commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Both CI failures exist on main:

@meta-codesync

meta-codesync Bot commented Aug 19, 2026

Copy link
Copy Markdown

@warrendeng has imported this pull request. If you are a Meta employee, you can view this in D116691248.

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