mirror of
https://github.com/p-e-w/heretic.git
synced 2026-12-03 18:42:57 +07:00
[PR #28] [MERGED] Fix support for MXFP4 quantized models with Triton tensors #242
Labels
No labels
bug
enhancement
enhancement
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
p-e-w/heretic#242
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/p-e-w/heretic/pull/28
Author: @tymat
Created: 11/20/2025
Status: ✅ Merged
Merged: 11/20/2025
Merged by: @p-e-w
Base:
master← Head:fix-mxfp4-triton-tensor-support📝 Commits (1)
ecd7ffdFix support for MXFP4 quantized models with Triton tensors📊 Changes
1 file changed (+5 additions, -0 deletions)
View changed files
📝
src/heretic/model.py(+5 -0)📄 Description
Problem
When loading models with MXFP4 quantization (e.g.,
openai/gpt-oss-20b), heretic fails with:This occurs because the
transformerslibrary uses Triton tensors for MXFP4 quantized weights, andtorch.is_tensor()returnsFalsefor them, causing the assertion intry_add()to fail.Solution
Extract the underlying PyTorch tensor via the
.dataattribute when encountering Triton tensors. The.dataattribute contains a regular PyTorch tensor that supports all required operations (.device,.sub_(), matrix multiplication).Testing
openai/gpt-oss-20battn.o_projandmlp.down_projcomponentsEnvironment
Fixes loading MXFP4 quantized models while maintaining backward compatibility.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.