Repository navigation
[docs] Per-layer config - #48601
[docs] Per-layer config#48601
Conversation
CI recapDashboard: View test results in Grafana |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
| title: Customizing models | ||
| - local: heterogeneous_configurations | ||
| title: Heterogeneous configurations | ||
| title: Per-layer configurations |
There was a problem hiding this comment.
should we keep a reference to the old title somewhere?
There was a problem hiding this comment.
i think it's ok to leave it out, there are multiple instances of "heterogeneous" in the doc itself so it should still be searchable
| | [nvidia/Llama-3_3-Nemotron-Super-49B-v1_5](https://huggingface.co/nvidia/Llama-3_3-Nemotron-Super-49B-v1_5) | [meta-llama/Llama-3.3-70B-Instruct](https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct) | | ||
| | [nvidia/Llama-3_1-Nemotron-Ultra-253B-v1](https://huggingface.co/nvidia/Llama-3_1-Nemotron-Ultra-253B-v1) | [meta-llama/Llama-3.1-405B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct) | | ||
| | [nvidia/gpt-oss-puzzle-88B](https://huggingface.co/nvidia/gpt-oss-puzzle-88B) | [openai/gpt-oss-120b](https://huggingface.co/openai/gpt-oss-120b) | | ||
| | [nvidia/NVIDIA-Nemotron-Labs-3-Puzzle-75B-A9B-BF16](https://huggingface.co/nvidia/NVIDIA-Nemotron-Labs-3-Puzzle-75B-A9B-BF16) | [nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16](https://huggingface.co/nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16) | |
There was a problem hiding this comment.
We can also include gemma4, we refactored it with this feature
There was a problem hiding this comment.
IIRC the Gemma4 checkpoint doesn't contain per_layer_config but the Python class reworks it, still a very relevant model for this feature though!
| > `per_layer_config`. Prefer the explicit architecture when one exists. | ||
|
|
||
| Examples of heterogeneous checkpoints include: | ||
| The models below are heterogeneous checkpoints. Layers are not uniform across the stack. They use a dedicated architecture with `block_configs` and their own `model_type`, rather than `per_layer_config` on a standard architecture. |
There was a problem hiding this comment.
Good clarification! I’m working on #45332, which will let us migrate these checkpoints to per_layer_config and remove the need for remote code. Once they’re migrated, we can update this section accordingly.
|
|
||
| `per_layer_config` records and resolves configuration values. It does not by itself change the modules a model creates | ||
| or how those modules run. Applying a size override or a `skip` requires model code that reads the resolved per-layer | ||
| configuration when constructing or running each layer. The current `LlamaModel` constructs every `LlamaDecoderLayer` |
There was a problem hiding this comment.
I find it a little confusing to mention LlamaModel and LlamaDecoderLayer here, since they don't consume per_layer_config. I think it would be clearer to focus on what this example demonstrates, which is specifying and resolving the configs, and note that applying them to a model would require modeling support.
|
@stevhliu Thanks for looping me in and making these improvements! I was a little late with my comments, but glad to see this merged :) |
Some updates and edits to improve the docs:
per_layer_configso the motivation arrives faster for why to reach for this power feature@eladsegal, if you could also take a look that'd be awesome 😄