Skip to content

Disable sam_fast custom flash without Triton block pointers - #2700

Closed
warrendeng wants to merge 1 commit into
pytorch:mainfrom
warrendeng:codex/sam-fast-disable-flash-without-blockptr
Closed

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

Conversation

@warrendeng

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 use its documented SEGMENT_ANYTHING_FAST_USE_FLASH_4=0 switch when they are unavailable. 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

Copy link
Copy Markdown
Contributor Author

Superseded by #2701, which uses a branch in pytorch/benchmark so the repository CI credentials are available.

@warrendeng warrendeng closed this Aug 19, 2026
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.

1 participant