Fix: set active CUDA device per layer for BMM/FMHA
This commit is contained in:
@@ -366,9 +366,10 @@ def main():
|
||||
target_gpu = li % NUM_GPUS
|
||||
target_device = f"cuda:{target_gpu}"
|
||||
|
||||
# Move activation to layer's GPU
|
||||
# Move activation to layer's GPU and set as active device
|
||||
if x.device != torch.device(target_device):
|
||||
x = x.to(target_device)
|
||||
torch.cuda.set_device(target_gpu)
|
||||
|
||||
lw = layer_weights[li]
|
||||
rc, rs = rope_caches[target_gpu]
|
||||
|
||||
Reference in New Issue
Block a user