#16100·Speech

Lhotse RIR 增强是从 seed 而不是 shard_seed 进行种子化的,因此所有等级都会获得相同的回荡效果

作者: udsy19创建于 2026年8月18日更新于 2026年9月27日
标签community-request

Describe the bug

In nemo/collections/common/data/lhotse/dataloader.py, the RIR augmentation is the only augmentation transform attached to the sampler that is seeded from config.seed instead of config.shard_seed:

python
# nemo/collections/common/data/lhotse/dataloader.py:1011-1018
if config.rir_enabled:
    sampler = sampler.map(
        ReverbWithImpulseResponse(
            rir_recordings=RecordingSet.from_file(config.rir_path) if config.rir_path is not None else None,
            p=config.rir_prob,
            randgen=random.Random(config.seed),      # <-- here
        )
    )

Every sibling transform in the same function uses seed=config.shard_seed:

line transform seed argument
861 on-the-fly noise mix (cuts.mix) seed=config.shard_seed
939 DynamicBucketingSampler seed=config.shard_seed
962 DynamicCutSampler seed=config.shard_seed
995 LowpassUsingResampling seed=config.shard_seed
1007 ClippingTransform seed=config.shard_seed
1016 ReverbWithImpulseResponse randgen=random.Random(config.seed)
1032 Compress seed=config.shard_seed

shard_seed defaults to "trng" (:109) and is resolved inside each process (resolve_seed("trng") is secrets.randbelow(2**31)), which is what makes ranks differ. config.seed defaults to 0 (:162) and is resolved to a concrete integer up front, before the sampler is built:

内容来源: NVIDIA-NeMo/Speech