We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8c1889e + 8196de1 commit 2223891Copy full SHA for 2223891
megatron/initialize.py
@@ -158,6 +158,15 @@ def _compile_dependencies():
158
print('>>> done with dataset index builder. Compilation time: {:.3f} '
159
'seconds'.format(time.time() - start_time), flush=True)
160
161
+ try:
162
+ # Skip the rest if the kernels are unnecessary or already available (ex. from apex)
163
+ if args.use_flash_attn or args.masked_softmax_fusion:
164
+ import scaled_upper_triang_masked_softmax_cuda
165
+ import scaled_masked_softmax_cuda
166
+ return
167
+ except ImportError:
168
+ pass
169
+
170
# ==================
171
# Load fused kernels
172
0 commit comments