Skip to content

Commit 99dad24

Browse files
committed
fix: remove useless warmup from __init__ (model on CPU, no compilation)
Warmup at init time runs before Lightning moves the model to GPU, so Triton cannot compile kernels there. Remove the calls entirely; compilation happens naturally on the first real training step. Also fix default glu_type to softsign_glu in both tasks.
1 parent e357c71 commit 99dad24

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

training/acoustic_task.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,13 @@ def __init__(self):
101101

102102
# ── Fuse LYNXNet2 backbone kernels (in-place) ──
103103
if hparams.get('use_fused_kernels', False):
104-
from modules.kernels.integration import patch_diffusion_module, warmup_fused_backbone
104+
from modules.kernels.integration import patch_diffusion_module
105105
from lightning.pytorch.utilities.rank_zero import rank_zero_info
106106
n = patch_diffusion_module(
107107
self.model.diffusion,
108108
glu_type=hparams['backbone_args'].get('glu_type', 'softsign_glu'),
109109
)
110110
rank_zero_info('Fused kernels: patched %d LYNXNet2 blocks', n)
111-
if n > 0:
112-
backbone = getattr(self.model.diffusion, 'denoise_fn',
113-
getattr(self.model.diffusion, 'velocity_fn', None))
114-
if backbone is not None:
115-
# Warmup with realistic M matching max_batch_frames
116-
warmup_M = hparams.get('max_batch_frames', 50000)
117-
warmup_fused_backbone(backbone, M=warmup_M)
118-
rank_zero_info('Fused kernels: autotune complete')
119111

120112
def _build_model(self):
121113
return DiffSingerAcoustic(

training/variance_task.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,14 @@ def __init__(self):
125125
# small for Triton fusion to benefit. The compilation overhead outweighs
126126
# the HBM savings. Fused kernels for acoustic model only (K=1024).
127127
if hparams.get('use_fused_kernels', False):
128-
from modules.kernels.integration import warmup_fused_backbone
128+
from modules.kernels.integration import patch_variance_model
129129
from lightning.pytorch.utilities.rank_zero import rank_zero_info
130-
rank_zero_info('Fused kernels: skipping variance model (small backbones, no benefit)')
130+
n = patch_variance_model(
131+
self.model,
132+
glu_type=hparams.get('backbone_args', {}).get('glu_type', 'softsign_glu'),
133+
)
134+
rank_zero_info('Fused kernels: patched %d LYNXNet2 blocks in variance model', n)
135+
131136

132137
def _build_model(self):
133138
return DiffSingerVariance(

0 commit comments

Comments
 (0)