-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ROCm: default GPT-OSS to BF16 and disable AITER #4021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
4e1e24c
3daaff6
cff534d
24c7f2e
458af41
a211e8c
b56ab6a
4f138ac
9956d1d
28aa6c2
f0da826
734649e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -275,6 +275,18 @@ def from_pretrained( | |
| ) | ||
| load_in_4bit = False | ||
|
|
||
| # AMD GPT-OSS: default to BF16 checkpoints to avoid MXFP4/prequant issues | ||
| if is_hip() and "gpt-oss" in model_name.lower() and not use_exact_model_name: | ||
| if not model_name.lower().endswith("-bf16"): | ||
| if "120b" in model_name.lower(): | ||
| model_name = "unsloth/gpt-oss-120b-BF16" | ||
| else: | ||
| model_name = "unsloth/gpt-oss-20b-BF16" | ||
|
||
| load_in_4bit = False | ||
| load_in_8bit = False | ||
| load_in_fp8 = False | ||
| load_in_16bit = True | ||
|
|
||
| # Find FP8, BnB 4bit, other mapped names | ||
| old_model_name = model_name | ||
| fp8_mode = None | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current logic for selecting the BF16 version of a GPT-OSS model assumes that any model not containing '120b' is a '20b' model. This is not robust and could lead to incorrectly loading the 20b model for other sizes (e.g., a hypothetical 60b model). I suggest making this logic more explicit by handling the '20b' case and adding a warning for any other unhandled sizes.