Unverified Commit df39a7c2 authored by Paweł Gadziński's avatar Paweł Gadziński Committed by GitHub
Browse files

Docs fix (#2301)



* init
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci



* fix
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* lines lenght
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* fix
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* fix
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* fix
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* subtitle --- fix in many files:
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* cross entropy _input -> input rename
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* cross entropy _input -> input rename
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci



* fix
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* a lot of small fixes
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* torch_version() change
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci



* add missing module and fix warnings
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci



* fix
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci



* fix
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* fix
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* removed training whitespace:
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* Update docs/api/pytorch.rst
Co-authored-by: default avatargreptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: default avatarPaweł Gadziński <62263673+pggPL@users.noreply.github.com>

* Fix import
Signed-off-by: default avatarKirthi Shankar Sivamani <ksivamani@nvidia.com>

* Fix more imports
Signed-off-by: default avatarKirthi Shankar Sivamani <ksivamani@nvidia.com>

* Fix NumPy docstring parameter spacing and indentation

- Standardize parameter documentation to use 'param : type' format (space before and after colon) per NumPy style guide
- Fix inconsistent indentation in cpu_offload.py docstring
- Modified 51 Python files across transformer_engine/pytorch
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci



* fix
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>

---------
Signed-off-by: default avatarPawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: default avatarPaweł Gadziński <62263673+pggPL@users.noreply.github.com>
Signed-off-by: default avatarKirthi Shankar Sivamani <ksivamani@nvidia.com>
Co-authored-by: default avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: default avatargreptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: default avatarKirthi Shankar Sivamani <ksivamani@nvidia.com>
parent ca468ebe
...@@ -382,26 +382,26 @@ class NVFP4Tensor(NVFP4TensorStorage, QuantizedTensor): ...@@ -382,26 +382,26 @@ class NVFP4Tensor(NVFP4TensorStorage, QuantizedTensor):
Parameters Parameters
---------- ----------
rowwise_data: torch.Tensor rowwise_data : torch.Tensor
Raw FP4 data in a uint8 tensor (rowwise layout). Raw FP4 data in a uint8 tensor (rowwise layout).
rowwise_scale_inv: torch.Tensor rowwise_scale_inv : torch.Tensor
Reciprocal of the scaling factor applied when Reciprocal of the scaling factor applied when
casting to FP4, i.e. the scaling factor that must casting to FP4, i.e. the scaling factor that must
be applied when casting from FP4 to higher be applied when casting from FP4 to higher
precision (rowwise). precision (rowwise).
columnwise_data: torch.Tensor, optional columnwise_data : torch.Tensor, optional
Raw FP4 data in a uint8 tensor (columnwise layout). Raw FP4 data in a uint8 tensor (columnwise layout).
columnwise_scale_inv: torch.Tensor, optional columnwise_scale_inv : torch.Tensor, optional
Reciprocal of the scaling factor for columnwise FP4 data. Reciprocal of the scaling factor for columnwise FP4 data.
amax_rowwise: torch.Tensor, optional amax_rowwise : torch.Tensor, optional
Rowwise amax tracking tensor. Rowwise amax tracking tensor.
amax_columnwise: torch.Tensor, optional amax_columnwise : torch.Tensor, optional
Columnwise amax tracking tensor. Columnwise amax tracking tensor.
fp4_dtype: TE_DType fp4_dtype : TE_DType
The FP4 data type used for quantization. The FP4 data type used for quantization.
quantizer: Quantizer quantizer : Quantizer
The quantizer instance used for this tensor. The quantizer instance used for this tensor.
dtype: torch.dtype, default = torch.float32 dtype : torch.dtype, default = torch.float32
Nominal tensor datatype, used in dequantize. Nominal tensor datatype, used in dequantize.
""" """
......
...@@ -74,7 +74,7 @@ def cast_master_weights_to_fp8( ...@@ -74,7 +74,7 @@ def cast_master_weights_to_fp8(
fsdp_shard_model_weights : list of FSDP shard model weights. If None, it means that the model weights are fsdp_shard_model_weights : list of FSDP shard model weights. If None, it means that the model weights are
not sharded. Otherwise, it means that the model weights are sharded and we get not sharded. Otherwise, it means that the model weights are sharded and we get
target model weights data storage using the FSDP shard model weights. target model weights data storage using the FSDP shard model weights.
manual_post_all_gather_processing: bool, default = `False`. manual_post_all_gather_processing : bool, default = `False`.
If False, post processing will be automatically triggered during next forward. If False, post processing will be automatically triggered during next forward.
If True, the timing of calling post_all_gather_processing is left to the user. If True, the timing of calling post_all_gather_processing is left to the user.
Note that users must call `post_all_gather_processing` if it's set to True, Note that users must call `post_all_gather_processing` if it's set to True,
......
# Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# See LICENSE for license information.
"""PyTorch version utilities"""
from __future__ import annotations
import functools
import torch
from packaging.version import Version as PkgVersion
@functools.lru_cache(maxsize=None)
def torch_version() -> tuple[int, ...]:
"""Get PyTorch version"""
return PkgVersion(str(torch.__version__)).release
This diff is collapsed.
...@@ -12,8 +12,8 @@ from contextlib import nullcontext ...@@ -12,8 +12,8 @@ from contextlib import nullcontext
import numpy as np import numpy as np
import torch import torch
from . import torch_version
from .quantized_tensor import Quantizer from .quantized_tensor import Quantizer
from .torch_version import torch_version
from ..debug.pytorch.debug_quantization import DebugQuantizedTensor from ..debug.pytorch.debug_quantization import DebugQuantizedTensor
...@@ -601,7 +601,7 @@ def get_nvtx_range_context(msg: str): ...@@ -601,7 +601,7 @@ def get_nvtx_range_context(msg: str):
Parameters Parameters
---------- ----------
msg: str msg : str
Message to associate with profiling context. Message to associate with profiling context.
""" """
...@@ -619,7 +619,7 @@ def nvtx_range_push(msg: str) -> None: ...@@ -619,7 +619,7 @@ def nvtx_range_push(msg: str) -> None:
Parameters Parameters
---------- ----------
msg: str msg : str
Message to associate with range Message to associate with range
""" """
...@@ -637,7 +637,7 @@ def nvtx_range_pop(msg: Optional[str] = None) -> None: ...@@ -637,7 +637,7 @@ def nvtx_range_pop(msg: Optional[str] = None) -> None:
Parameters Parameters
---------- ----------
msg: str, optional msg : str, optional
Message associated with range Message associated with range
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment