Skip to content
This repository was archived by the owner on Jul 8, 2026. It is now read-only.

Auto scaling factor tuning on FP8 weight gradients reduction for Megatron-LM#21

Open
wkcn wants to merge 3 commits into
Azure:mainfrom
wkcn:wgrad_auto_scaling
Open

Auto scaling factor tuning on FP8 weight gradients reduction for Megatron-LM#21
wkcn wants to merge 3 commits into
Azure:mainfrom
wkcn:wgrad_auto_scaling

Conversation

@wkcn

@wkcn wkcn commented Dec 8, 2023

Copy link
Copy Markdown

Related PR in MS-AMP repo: Azure/MS-AMP#140

Add 3 arguments in Megatron-LM patch.

+    # Auto scaling factor tuning for FP8 collective communication
+    group.add_argument('--wgrad-auto-scaling', action='store_true', default=False,
+                       help='whether to enable auto scaling factor tuning on weight gradients reduction')
+    group.add_argument('--wgrad-auto-scaling-freq', type=int, default=10,
+                       help='the frequency of checking whether overflow exists in the result of weight gradients reduction')
+    group.add_argument('--wgrad-auto-scaling-ratio', type=float, default=1e-3,
+                       help='the threshold of overflow ratio for auto scaling factor tuning on weight gradients reduction')
+    group.add_argument('--wgrad-auto-scaling-window', type=int, default=100,
+                       help='the window size for auto scaling factor tuning on weight gradients reduction')

@wkcn wkcn requested review from guoshzhao and tocean December 12, 2023 06:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant