Skip to content

Commit

Permalink
tfacc attention speedup
Browse files Browse the repository at this point in the history
  • Loading branch information
黄宇扬 committed May 8, 2024
1 parent 0d9765a commit cf1f6b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/devices/tfacc/fastllm-tfacc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,13 @@ namespace fastllm {
U8Buffer buffer;
buffer.WriteInt(configString.size());
buffer.WriteBytes((uint8_t*)configString.data(), configString.size());
buffer.WriteBytes(q->cpuData, q->GetBytes());
//buffer.WriteBytes(q->cpuData, q->GetBytes());

memcpy((uint8_t*)this->buf, buffer.buffer.data(), buffer.buffer.size());
RunMultiThreadMemcpy((uint8_t*)this->buf, buffer.buffer.data(), buffer.buffer.size(), GetAlivePool());
RunMultiThreadMemcpy((uint8_t*)this->buf + buffer.buffer.size(), q->cpuData, q->GetBytes(), GetAlivePool());
this->Launch(opType);
this->Wait();

memcpy(output->cpuData, (uint8_t*)result, output->GetBytes());
RunMultiThreadMemcpy(output->cpuData, (uint8_t*)result, output->GetBytes(), GetAlivePool());
}
}
Binary file modified third_party/tfacc/server
Binary file not shown.

0 comments on commit cf1f6b1

Please sign in to comment.