Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions megatron/core/distributed/distributed_data_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,18 @@ def __init__(
# If bucketing is explicitly disabled, then put all buckets in a buffer into a single
# bucket group.
self.bucket_groups = partition_buckets(
self.buffers, force_single_bucket_group=disable_bucketing
self.buffers,
force_single_bucket_group=disable_bucketing,
reduce_scatter_with_fp32_accumulation=(
self.ddp_config.reduce_scatter_with_fp32_accumulation
),
)
self.expert_parallel_bucket_groups = partition_buckets(
self.expert_parallel_buffers, force_single_bucket_group=disable_bucketing
self.expert_parallel_buffers,
force_single_bucket_group=disable_bucketing,
reduce_scatter_with_fp32_accumulation=(
self.ddp_config.reduce_scatter_with_fp32_accumulation
),
)

if self.ddp_config.num_distributed_optimizer_instances > 1:
Expand Down
3 changes: 2 additions & 1 deletion megatron/core/fp4_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def modify_nvfp4_rowwise_storage(fp4_tensor: torch.Tensor, new_rowwise_data: tor
), "Rowwise NVFP4 storage must be uint8"
# Preserve existing values and then swap storage
new_rowwise_data.detach().copy_(old_rowwise)
setattr(fp4_tensor, "_rowwise_data", new_rowwise_data)
fp4_tensor._rowwise_data = new_rowwise_data
del old_rowwise


def quantize_nvfp4_param_shard(
Expand Down
Loading