Skip to content

Conversation

@bzantium
Copy link
Collaborator

@bzantium bzantium commented Nov 4, 2025

Description

Fixed incorrect quantization option names and descriptions in the inline comments of src/MaxText/configs/base.yml to match the actual implementation in the codebase.

The comments previously contained incorrect option names and misleading descriptions that didn't align with the valid options defined in pyconfig.py and implemented in quantizations.py.

Why this change is being made

Users relying on these inline comments could:

  1. Use the invalid option 'nanoo_fp8' (which doesn't exist) instead of the correct 'fp8_nanoo', leading to validation errors
  2. Incorrectly assume 'fp8' is NVIDIA GPU-specific, when the actual GPU-optimized option is 'fp8_gpu'
  3. Miss the 'fp8_gpu' option entirely since it wasn't documented

Changes made

  • Fixed incorrect option name: 'nanoo_fp8''fp8_nanoo' to match code
  • Added missing option: 'fp8_gpu' for NVIDIA GPU-specific quantization
  • Corrected descriptions:
    • 'int8': "dynamic range quantization using 8-bits" → "8-bit integer quantization"
    • 'fp8': removed "on NVIDIA GPUs" as it's the generic FP8 option
    • Added explicit GPU vendor information for 'fp8_gpu' and 'fp8_nanoo'
  • Reordered options to match the sequence in documentation

Why this is a good solution

The comments now serve as accurate inline documentation that matches:

  • The valid_quant_methods tuple in pyconfig.py
  • The case statement implementation in quantizations.py
  • The external documentation in docs/explanations/quantization.md

This ensures consistency across all documentation sources and prevents user confusion.

Implementation

This is purely a documentation change - no code logic was modified. Only the inline comments in base.yml were updated.

FIXES: #2593

Tests

This change only modifies inline comments in the YAML configuration file and does not affect code functionality. Testing performed:

  1. Syntax validation: Verified YAML file syntax remains valid
  2. Cross-reference check: Confirmed all documented option names match:

To verify the documentation accuracy:

# Check option names in code
grep -n "valid_quant_methods" src/MaxText/pyconfig.py
grep -n "case \"fp8" src/MaxText/layers/quantizations.py

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

- Corrected 'nanoo_fp8' → 'fp8_nanoo' to match code implementation
- Added missing 'fp8_gpu' option
- Fixed misleading 'fp8' description (not NVIDIA-specific)
- Aligned all option names with pyconfig.py and quantizations.py

Prevents users from using invalid option names and choosing wrong
quantization methods due to incorrect descriptions.
@bzantium bzantium changed the title Fix quantization option names in base.yml comments Fix quantization options in base.yml comments Nov 5, 2025
@bzantium bzantium changed the title Fix quantization options in base.yml comments Fix quantization option comments in base.yml Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation: base.yml comments don't match actual quantization option names in code

1 participant