Skip to content

Conversation

@ksivaman
Copy link
Member

Description

Document all environment variables used in TE.

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Document all environment variables used in TE.

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
@ksivaman ksivaman requested a review from pggPL December 31, 2025 12:59
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 31, 2025

Greptile Summary

This PR adds comprehensive documentation for all environment variables used in Transformer Engine by creating a new docs/envvars.rst file and adding it to the documentation index.

Key additions:

  • Documents 50+ environment variables organized into logical categories (Build-Time and Runtime)
  • Build-time variables cover build configuration, optional dependencies, and CUDA settings
  • Runtime variables cover attention backends, FP8 configuration, kernel settings, debugging, profiling, and framework-specific options
  • Each variable includes type, default value, and detailed description
  • Includes practical examples showing common usage patterns
  • Well-structured with ReStructuredText formatting and cross-references using :envvar: directives

The documentation is comprehensive, well-organized, and aligns with the existing codebase usage of these environment variables.

Confidence Score: 5/5

  • This PR is safe to merge - it only adds documentation without modifying any code
  • Documentation-only change with no code modifications. The environment variables documented match actual usage in the codebase. Well-structured ReStructuredText formatting follows Sphinx conventions. No functional or security risks.
  • No files require special attention

Important Files Changed

Filename Overview
docs/envvars.rst New comprehensive documentation for all TransformerEngine environment variables covering build-time and runtime configuration
docs/index.rst Added envvars documentation to Advanced section of documentation index

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Docs as Documentation System
    participant Rst as envvars.rst
    participant Index as index.rst
    participant Users as Users/Readers

    Dev->>Rst: Create new envvars.rst file
    Note over Rst: Document 50+ environment variables<br/>organized by category
    Rst-->>Rst: Build-time variables<br/>(NVTE_BUILD_*, NVTE_CUDA_*)
    Rst-->>Rst: Runtime variables<br/>(Attention, FP8, Kernels, etc.)
    Rst-->>Rst: Examples section
    
    Dev->>Index: Update index.rst
    Note over Index: Add envvars to<br/>Advanced section
    
    Dev->>Docs: Submit documentation PR
    
    Docs->>Users: Build and publish docs
    Note over Users: Users can now reference<br/>comprehensive envvar guide
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments (1)

  1. docs/envvars.rst, line 380-399 (link)

    style: Missing NVTE_DPA_FP8_RECIPE_DPA and NVTE_DPA_FP8_RECIPE_MHA (used in transformer_engine/pytorch/attention/multi_head_attention.py:42-43). Also missing: NVTE_AG_P2P_MULTI_ATOMIC, NVTE_APPLY_QK_LAYER_SCALING, NVTE_BATCH_MHA_P2P_COMM, NVTE_CUDA_ARCHS, several internal/experimental variables

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 31, 2025

Greptile's behavior is changing!

From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

Signed-off-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
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.

1 participant