transformers
Add GPT OSS model from OpenAI
#39923
Merged
Go
Login via GitHub
Home
Pricing
FAQ
Install
Login
via GitHub
Overview
Commits
421
Changes
View On
GitHub
Add GPT OSS model from OpenAI
#39923
ArthurZucker
merged 421 commits into
main
from
add-oai
fix
546efee6
nice
7b077aee
where i am at
ebcae9a9
Bro this works
528b3c85
Merge pull request #16 from huggingface/fix-attention
9c61a8cd
Update src/transformers/integrations/tensor_parallel.py
297e47e2
Merge pull request #11 from huggingface/tp_embed_parallel
2f852e27
cleanups
3d25cf75
Merge branch 'add-oai' into add-fast-flash-kernel
ff0544bf
yups that was breaking
29454d2e
Merge branch 'add-fast-flash-kernel' of github.com:huggingface/new-mo…
b3582fc8
Merge pull request #15 from huggingface/add-fast-flash-kernel
f33a74d6
Merge branch 'main' of github.com:huggingface/new-model-addition-open…
1f3ae2b3
Update src/transformers/models/openai_moe/modeling_openai_moe.py
15c85e0e
merge
0c7379ae
gather on experts and not mlp
ad0fc38f
add changes for latest convert branch
4fb73451
adds options to get output_router_logits from config
968238ca
bring chat temlate + special tokens back into the script.
4bc55572
Merge pull request #22 from huggingface/vb/special-tok
68fd8339
Merge pull request #21 from huggingface/ed-fix-modeling
410435a2
initial commmit
07bd34d4
update
b7987d2e
working with shards
2c0fd4d3
add model.safetensors.index.json
1d03f3ac
fix
40e379d1
fix
b68aa6b4
mxfp4 flag
a87db4f4
rm print
c3c01f07
Fix PAD/EOS/BOS (#18)
863630d9
add some doc
eab251f7
Merge pull request #23 from huggingface/update_conversion_script
928b9b6c
special tokens based on harmony.
9280e590
add in tokenizer config as well.
b382c5e0
Merge pull request #25 from huggingface/vb/upd-conversion-script
7cdd0be9
prepare for rebase with main
f8f3e40a
Merge branches 'add-oai' and 'add-oai' of github.com:huggingface/new-…
c9dc8f29
merge with main
0ce752c6
Fix for initialize_tensor_parallelism now returning 4-tuple
60af8419
mxfp4
1ce172b4
mxfp4 draft
c0bee222
fix
fe896d36
fix import
174147df
draft
b8215ddd
draft impl
62f77e17
finally working !
6e9d0c72
simplify
6b8b279f
add import
ea5c364a
working version
1175ab46
consider blocks and scales
d53cb49e
device mesh fix
8c43631f
initial commit
4f515ebc
add working dequant + quant logic
0ff67272
update
13cb07b0
non nan, gibberish output
39888563
working EP + quantization finally !
b9c8138b
start cleaning
5117d71e
remove reversing process
3733a349
style
65873596
some cleaning
79610731
initial commmit
0de006a2
more cleaning
12a9e802
more cleaning
39047834
simplify
75e0f21a
more cleaning
c8ce0473
rm duplicated function
8b162f70
changing tp_plan
8a00f600
update tp plan check
d760f30c
add loading attribute
b34570e7
dequantizing logic
a4950aa6
use subfunctions
89b06710
import cleaning
7bfdca61
update_param_name
21872bd0
adds clamped swiglu
b68ece87
add clamping to training path
3e106d62
simplify dequant logic
1716e6d8
Merge branch 'main' of github.com:huggingface/new-model-addition-open…
f49bcbb9
update
b8b00238
Merge branch 'add-oai' of github.com:huggingface/new-model-addition-o…
6400fb29
Bad merge
69761698
more simplifications & tests
195cca63
fix !
345afb13
Merge pull request #26 from huggingface/add-clamp-swiglu
7b18304a
fix registering custom attention
009355a6
fix order
d237a90c
fixes
ccffc0b9
some test nits
f92878af
nits
90522c41
nit
dbb8b20a
Merge branch 'add-oai' into adding_packing_format_option
d5634bda
Merge pull request #20 from huggingface/adding_packing_format_option
587d8dae
fix
edd92321
Merge pull request #27 from huggingface/guard_kernels_imports
c0ef1563
Clamp sink logits
dc2b16fe
Clean
b0508307
Soft-max trick
e0e406ec
Clean up
54e88254
p
0378ae86
Merge pull request #28 from huggingface/fix-train-bsz
a2089800
fix deepspeed
077cfeef
update both modeling and modular for cleanup
bec11b79
contiguous
7d8ac2ed
update tests
42ab1088
fix top_k router call
e9f130a5
revert renaming
da77d5e3
test nits
5b0bd402
Merge branch 'add-oai' of github.com:huggingface/new-model-addition-o…
9af87b2b
small fixes for EP
b43d2cd4
fix path for our local tests
13ec4ef3
Merge branch 'add-oai' of github.com:huggingface/new-model-addition-o…
0b5a0e97
update as I should not have broken that!
0276225a
Merge branch 'add-oai' of github.com:huggingface/new-model-addition-o…
f1cf9519
fix the loss of mixtral
a34b39ca
revert part of the changes related to router_scores, kernel probably …
e7cc5914
Merge branch 'add-oai' of github.com:huggingface/new-model-addition-o…
b7a9e4aa
deleting a small nit
f1245b4c
Merge branches 'add-oai' and 'add-oai' of github.com:huggingface/new-…
8a6fbf9b
update arch
9b387ca9
fix post processing
6c0effa9
update
ab0f9295
Merge pull request #30 from huggingface/fix-conversion-architecture
e030193d
running version but not expected output
c80bd448
Merge pull request #29 from huggingface/fix_ds
6c55b12a
Merge remote-tracking branch 'origin/add-oai' into update-triton-kernels
740f3aa3
moving to cuda
dc125183
initial commit
20dfa56d
revert
228a9826
erroring when loading on cpu
5a597336
updates
910ccfec
del blocks, scales
212acd0f
fix
5c6d3b2c
style
5ec240fc
rm comm
2faa7ca4
comment
c5b8cecd
add comment
79dd4fc1
Merge pull request #36 from huggingface/default_to_dequantize_training
93f0816d
Merge branch 'add-oai' into update-triton-kernels
c5e7bfcb
style
d238ea4e
Merge pull request #31 from huggingface/update-triton-kernels
76f90886
remove duplicated lines
a7dd97fd
Fix minor issue with weight_map conversion script
cf4843b4
fix sampling params
8b7a73f2
rename to final name
08b031b7
Merge branch 'add-oai' into zhuohan/fix-sampling-parmsl
a39ebae3
Merge pull request #37 from huggingface/zhuohan/fix-sampling-parmsl
8430860a
upate pre-final version of template
0d1a2da4
Update src/transformers/models/gpt_oss/convert_gpt_oss_weights_to_hf.py
5f3de46c
Merge pull request #38 from huggingface/vb/upd-template
ce4e9129
fix batched inference
bddc8c2a
Merge pull request #39 from huggingface/fix_batched_inference
b2b1ca50
serve fixes
06b35eb5
swizzle !
0de8f627
Merge branch 'add-oai' into swizzle
a29c5a2d
update final chat template by Matt.
aca1e72b
fix responses; pin oai
a8c3c493
sinplify
33636c91
Thanks Matt for his tireless efforts!
af6fb990
`transformer serve` fixes for oai (mostly hide CoT)
22e8236f
Update src/transformers/models/gpt_oss/convert_gpt_oss_weights_to_hf.py
6f91a55a
fix
afe89129
Merge pull request #42 from huggingface/swizzle
b7dc08c1
Merge pull request #41 from huggingface/vb/up-template-2
e991ef4c
Use ROCm kernels from HUB
7e540fc3
Make kernel modes explicit
3e4ad36a
Merge pull request #43 from huggingface/rocm-kernels-support
fa6eee9c
update final chat template by Matt. x2
e946804b
Thanks Matt for his tireless efforts!
1a8728d6
Merge pull request #44 from huggingface/vb/up-template-3
f3225067
Fix installation
50b82506
Update setup.py
dec98d80
allow no content
0c6f911d
fix: update message handling in write_tokenizer function
181c625a
Merge pull request #45 from huggingface/fix-install
fa7a66dd
Fix template logic for user message role
7c741230
Merge pull request #47 from huggingface/fix-chat-template
672bc172
Merge branch 'main' of github.com:huggingface/new-model-addition-open…
402976da
Merge branch 'add-oai' of github.com:huggingface/new-model-addition-o…
5509620c
last nits for CB and flash_paged!
9d27880c
there was one bad merge
4cf6186b
fix CB (hardcode for now, its just using kv groups instead)
cac4c098
fix
eeef8c8d
better fix for device_map
45fbc185
Merge pull request #48 from huggingface/fix_target_device
92a2a498
minor device fix
6dd3a723
Fix flash paged
5ef7f3f4
Merge branch 'add-oai' of github.com:huggingface/new-model-addition-o…
47ae152a
updates
d2303c71
Revert "remove dtensors, not explicit (#39840)"
ed511f21
Merge pull request #46 from huggingface/fix-tool-chat-template
d8092b99
update
e9b3708e
Revert "remove dtensors, not explicit (#39840)"
70750d9a
fix merge
35576899
Merge branch 'add-oai' of github.com:huggingface/new-model-addition-o…
fbc68154
fix
b939303b
Fix line break when custom model indentity
d238182f
Merge pull request #49 from huggingface/fix_import_triton_kernels
7c364da1
nits testing
088a6070
to locals first and pass sliding window to flash paged
d91814b5
Merge branch 'add-oai' of github.com:huggingface/new-model-addition-o…
b392bc5e
register modes for MegaBlocksMoeMlp
27bd828d
add integration test in fixtures -> now update the tests to use it!
b667b7c1
update integration tests
afffd581
initial fix
00d6703c
style and update tests
6a8710ec
fix
4cb0a93a
Merge pull request #53 from huggingface/fix_warning
b6965318
Merge pull request #52 from huggingface/fix_kernels
a9b7b399
chore(gpt oss): remove mlp_bias from configuration
b9f34dd6
stats
eb942a6b
Integration tests
94a85f0a
whoops
210067a3
Shouldn't move model
e60807a7
Merge pull request #57 from huggingface/add-oai-integration-test-fixes
2718a7c9
Merge pull request #50 from huggingface/fix-line-break
093ffd56
Ensure assistant messages without thinking always go to "final" channel
c954ef7d
More checks to ensure expected format
13f67567
Merge pull request #54 from huggingface/remove-mlp_bias
6ef5c342
Add pad_token_id to model configuration in write_model function (#51)
bee0515d
Add oai fix fast tests (#59)
e1f46b45
Update src/transformers/models/gpt_oss/convert_gpt_oss_weights_to_hf.py
e29f6590
Update src/transformers/models/gpt_oss/convert_gpt_oss_weights_to_hf.py
5c6255ec
Update src/transformers/models/gpt_oss/convert_gpt_oss_weights_to_hf.py
889fe011
Merge pull request #58 from huggingface/update-template
25e8bd81
reasoning -> Reasoning
9844308a
Merge pull request #61 from huggingface/vb/upd-chat-temp-reasoning
563b5cf6
Add additional integration tests
b222c6ff
fixup
84210542
Slight fixes
60017719
align chat template with harmony
e360f176
simplify
5fe06b9e
Add comment
ba792c9d
torch testing assert close
afc0fc49
torch testing assert close
7bddb91b
torch testing assert close
4068437d
torch testing assert close
94f11c59
torch testing assert close
3660b2b3
torch testing assert close
974987fa
Merge pull request #56 from huggingface/better-stats
768b5821
Revert fixup
d881a200
Merge pull request #62 from huggingface/add-new-integration-tests
0c7db230
skip 2 test remove todo
66980045
Merge branch 'add-oai' of github.com:huggingface/new-model-addition-o…
208b83c1
merge
54cf55fa
padding side should be left for integration tests
f19e04b9
fix modular wrt to changes made to modeling
1f7cad06
style
6973ba40
Merge branch 'main' of github.com:huggingface/transformers into add-oai
9ab58975
isort
1f47841b
fix opies for the loss
865b368b
mmmm
75f13d05
LysandreJik
approved these changes on 2025-08-05
ArthurZucker
merged
7c38d8fc
into main
134 days ago
ArthurZucker
deleted the add-oai branch
134 days ago
ArthurZucker
added
New model
ArthurZucker
added
Model Parallel
ArthurZucker
added
Mixture of Experts
ArthurZucker
added
Flash Attention
Login to write a write a comment.
Login via GitHub
Reviewers
LysandreJik
Assignees
No one assigned
Labels
New model
Model Parallel
Flash Attention
Mixture of Experts
Milestone
No milestone
Login to write a write a comment.
Login via GitHub