Skip to content

Update the median_kernel() function to use the Triton v3 API#22

Closed
tokyovigilante wants to merge 1 commit intoufal:mainfrom
tokyovigilante:main
Closed

Update the median_kernel() function to use the Triton v3 API#22
tokyovigilante wants to merge 1 commit intoufal:mainfrom
tokyovigilante:main

Conversation

@tokyovigilante
Copy link
Contributor

Apparently kernel.src cannot be directly assigned in v3, so store src in a local copy and modify that one before applying the updates. This allows use with Python >3.11 and Debian trixie which does not package triton v2.

Tested on simulated streaming audio locally.

see openai/whisper#2597

Apparently kernel.src cannot be directly assigned in v3, so store src
in a local copy and modify that one before applying the updates.

Tested on simulated streaming audio locally.

see openai/whisper#2597
@Gldkslfmsd
Copy link
Member

Hi, thanks.
So is this exactly the same update as this openai/whisper@8689924 in the original Whisper on Jun 26?
Then the change is not identical. It's better if it was. We should follow the updates in openai/whisper repo except in the pieces of code that were changed in simul_whisper

krystophny added a commit to krystophny/SimulStreaming that referenced this pull request Oct 27, 2025
The previous commit added Triton 3.x support but broke backward
compatibility with Triton 2.x by requiring triton>=3.0.0.

This commit restores compatibility with both versions by following
the upstream OpenAI Whisper approach:
- Use hasattr() to detect which API is available
- Call _unsafe_update_src() + hash reset for Triton 3.0-3.1
- Fall back to kernel.src for Triton 2.x
- Restore triton>=2.0.0 requirement (supports both 2.x and 3.x)

This matches the implementation in openai/whisper and addresses
the maintainer feedback to follow upstream more closely.

Builds on: ufal#22
See: openai/whisper#2597
@fumin
Copy link

fumin commented Jan 27, 2026

@Gldkslfmsd #23 is the fix to #30 . Please merge it.

@Gldkslfmsd
Copy link
Member

going to use #PR23

@Gldkslfmsd Gldkslfmsd closed this Jan 27, 2026
Gldkslfmsd pushed a commit that referenced this pull request Jan 28, 2026
The previous commit added Triton 3.x support but broke backward
compatibility with Triton 2.x by requiring triton>=3.0.0.

This commit restores compatibility with both versions by following
the upstream OpenAI Whisper approach:
- Use hasattr() to detect which API is available
- Call _unsafe_update_src() + hash reset for Triton 3.0-3.1
- Fall back to kernel.src for Triton 2.x
- Restore triton>=2.0.0 requirement (supports both 2.x and 3.x)

This matches the implementation in openai/whisper and addresses
the maintainer feedback to follow upstream more closely.

Builds on: #22
See: openai/whisper#2597
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.

3 participants