DeepSeek engine: slot_load() writes each tensor-parallel member's window ring and compressor group under its own device (#4350)
slot_load() selected the lead layer's device once and then copied into every member of a tensor-parallel group; the members' buffers sit on their own GPUs, so on two identical cards (tp 2) the second member's copy ran with the wrong device current. A failed copy makes slot_load() fail, and slot_take() then deletes the saved conversation. Every other per-member loop (restore, reset) already selects the member's device; slot_load() now does too.
This commit is contained in:
1 parent
c7a0cef13a
commit
35c0c9a8ae
1 file changed
+2
@@ -5792,6 +5792,7 @@ struct Model::Impl {
|
||||
wrote = true;
|
||||
for (int m = 0; m < l.nm; ++m) {
|
||||
Layer& lm = member(l, m);
|
||||
cudaSetDevice(devs[(size_t) lm.dev].id); // (a tensor-parallel group's members sit on different GPUs: #4350)
|
||||
if (cudaMemcpy(lm.win, data + off, (size_t) wb, cudaMemcpyHostToDevice) != cudaSuccess) {
|
||||
err = l.name + "window ring: " + cudaGetErrorString(cudaGetLastError());
|
||||
return false;
|
||||
@@ -5812,6 +5813,7 @@ struct Model::Impl {
|
||||
}
|
||||
for (int m = 0; m < l.nm; ++m) {
|
||||
Layer& lm = member(l, m);
|
||||
cudaSetDevice(devs[(size_t) lm.dev].id);
|
||||
if (cudaMemcpy(lm.c_kv, data + off, cb, cudaMemcpyHostToDevice) != cudaSuccess ||
|
||||
cudaMemcpy(lm.c_score, data + off + cb, cb, cudaMemcpyHostToDevice) != cudaSuccess) {
|
||||
err = l.name + "compressor's group: " + cudaGetErrorString(cudaGetLastError());
|
||||
|
||||
Reference in new issue
Block a user