[KernelGen][Nvidia] Add _fake_quantize_learnable_per_channel_affine_backward operator with Triton kernel - #5543
Open
chx7514 wants to merge 4 commits into
Conversation
…ementation, tests and benchmark
chx7514
requested review from
0x45f,
103yiran,
Caeruleann,
bin913,
douxetpur,
hellojack163,
huangyiqun,
tengqm and
w1120029931-bit
as code owners
August 17, 2026 06:29
…_learnable_per_channel_affine_backward
chx7514
force-pushed
the
pr/_fake_quantize_learnable_per_channel_affine_backward
branch
from
August 17, 2026 06:58
c27a739 to
c2977a7
Compare
Collaborator
|
/test|_fake_quantize_learnable_per_channel_affine_backward:h20 |
…fine_backward Signed-off-by: Dongxu-H <dxhan@baai.ac.cn>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Triton kernel for
_fake_quantize_learnable_per_channel_affine_backward. Triton kernel implementation for_fake_quantize_learnable_per_channel_affine_backward,the backward of learnable per-channel fake quantization. Computes the gradients
with respect to the input, scale and zero-point, accounting for the saturation
branch where the quantized value is clamped to
[quant_min, quant_max].Testing
to_reference(inp, True)Performance
Test command:
pytest benchmark/test_fake_quantize_learnable_per_channel_affine_backward.py --level core(NVIDIA H20)fake_quantize_learnable_per_channel_affine_backward
Multi-backend Testing
Files Changed
src/flag_gems/ops/_fake_quantize_learnable_per_channel_affine_backward.py: Triton kernel implementationtests/test_fake_quantize_learnable_per_channel_affine_backward.py: Accuracy testbenchmark/test_fake_quantize_learnable_per_channel_affine_backward.py: Performance benchmarksrc/flag_gems/ops/__init__.py: Register import and__all__src/flag_gems/__init__.py: Register to_FULL_CONFIGconf/operators.yaml: Add operator entry (kind: Math, stage: alpha 5.4)