-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(doc): update gpt-oss readme #3029
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,71 @@ | ||
| # OpenAI's GPT-OSS | ||
| # Finetune OpenAI's GPT-OSS with Axolotl | ||
|
|
||
| GPT-OSS is a 20 billion parameter MoE model trained by OpenAI, released in August 2025. | ||
| [GPT-OSS](https://huggingface.co/collections/openai/gpt-oss-68911959590a1634ba11c7a4) are a family of open-weight MoE models trained by OpenAI, released in August 2025. There are two variants: 20B and 120B. | ||
|
|
||
| - 20B Full Parameter SFT can be trained on 8x48GB GPUs (peak reserved memory @ ~36GiB/GPU) - [YAML](./gpt-oss-20b-fft-fsdp2.yaml) | ||
| - 20B LoRA SFT (all linear layers, and experts in last two layers) can be trained a single GPU (peak reserved memory @ ~47GiB) | ||
| - removing the experts from `lora_target_parameters` will allow the model to fit around ~44GiB of VRAM | ||
| - [YAML](./gpt-oss-20b-sft-lora-singlegpu.yaml) | ||
| - 20B Full Parameter SFT with FSDP2 offloading can be trained on 2x24GB GPUs (peak reserved memory @ ~21GiB/GPU) - [YAML](./gpt-oss-20b-fft-fsdp2-offload.yaml) | ||
| This guide shows how to fine-tune it with Axolotl with multi-turn conversations and proper masking. | ||
|
|
||
| ## Getting started | ||
|
|
||
| 1. Install Axolotl following the [installation guide](https://docs.axolotl.ai/docs/installation.html). You need to install from main as GPT-OSS is only on nightly or use our latest [Docker images](https://docs.axolotl.ai/docs/docker.html). | ||
|
|
||
| Here is an example of how to install from main for pip: | ||
|
|
||
| ```bash | ||
| # Ensure you have Pytorch installed (Pytorch 2.6.0 min) | ||
| git clone https://github.com/axolotl-ai-cloud/axolotl.git | ||
| cd axolotl | ||
|
|
||
| pip3 install packaging==23.2 setuptools==75.8.0 wheel ninja | ||
| pip3 install --no-build-isolation -e '.[flash-attn]' | ||
| ``` | ||
|
|
||
| 2. Choose one of the following configs below for training the 20B model. | ||
|
|
||
| ```bash | ||
| # LoRA SFT linear layers & 2 experts (1x48GB @ ~47GiB) | ||
| # (only linear layers @ ~44GiB) | ||
| axolotl train examples/gpt-oss/gpt-oss-20b-sft-lora-singlegpu.yaml | ||
|
|
||
| # FFT SFT with offloading (2x24GB @ ~21GiB/GPU) | ||
| axolotl train examples/gpt-oss/gpt-oss-20b-fft-fsdp2-offload.yaml | ||
|
|
||
| # FFT SFT (8x48GB @ ~36GiB/GPU or 4x80GB @ ~46GiB/GPU) | ||
| axolotl train examples/gpt-oss/gpt-oss-20b-fft-fsdp2.yaml | ||
| ``` | ||
|
|
||
| Notes: | ||
| - 120B coming soon! | ||
| - Memory usage taken from `device_mem_reserved(gib)` from logs. | ||
|
|
||
| ### Tool use | ||
|
|
||
| GPT-OSS has a comprehensive tool understanding. Axolotl supports tool calling datasets for Supervised Fine-tuning. | ||
|
|
||
| Here is an example dataset config: | ||
| ```yaml | ||
| datasets: | ||
| - path: Nanobit/text-tools-2k-test | ||
| type: chat_template | ||
| ``` | ||
|
|
||
| See [Nanobit/text-tools-2k-test](https://huggingface.co/datasets/Nanobit/text-tools-2k-test) for the sample dataset. | ||
|
|
||
| Refer to [our docs](https://docs.axolotl.ai/docs/dataset-formats/conversation.html#using-tool-use) for more info. | ||
|
|
||
| ### TIPS | ||
|
|
||
| - Read more on how to load your own dataset at [docs](https://docs.axolotl.ai/docs/dataset_loading.html). | ||
| - The dataset format follows the OpenAI Messages format as seen [here](https://docs.axolotl.ai/docs/dataset-formats/conversation.html#chat_template). | ||
|
|
||
| ## Optimization Guides | ||
|
|
||
| - [Multi-GPU Training](https://docs.axolotl.ai/docs/multi-gpu.html) | ||
| - [Multi-Node Training](https://docs.axolotl.ai/docs/multi-node.html) | ||
|
|
||
| ## Related Resources | ||
|
|
||
| - [GPT-OSS Blog](https://openai.com/index/introducing-gpt-oss/) | ||
| - [Axolotl Docs](https://docs.axolotl.ai) | ||
| - [Axolotl Website](https://axolotl.ai) | ||
| - [Axolotl GitHub](https://github.com/axolotl-ai-cloud/axolotl) | ||
| - [Axolotl Discord](https://discord.gg/7m9sfhzaf3) | ||
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.
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.
Add a concrete Docker command and include
--ipc=host.The text tells users they “can … use our latest Docker images” but never shows a working
docker runexample. Given past incidents with PyTorch DataLoader shared-memory exhaustion, omit-ting--ipc=hostin user docs routinely leads to crashes. Please add an explicit command block such as:docker run --gpus all --ipc=host -v $PWD:/workspace axolotl/axolotl:latest \ axolotl train examples/gpt-oss/gpt-oss-20b-sft-lora-singlegpu.yamlThis both demonstrates usage and institutionalises the required flag.
🤖 Prompt for AI Agents