Skip to content

Commit 7c3b69d

Browse files
committed
fix: use malloc instead of mallocAsync, fix gpt2_2_bfloat16
1 parent d6d3813 commit 7c3b69d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

infini_train/src/core/runtime/maca/maca_guard_impl.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,17 @@ BlasHandle *MacaGuardImpl::GetBlasHandle(Device device) const {
221221
void MacaGuardImpl::Malloc(void **dev_ptr, size_t size) { MACA_CHECK(mcMalloc(dev_ptr, size)); }
222222

223223
void MacaGuardImpl::MallocAsync(void **dev_ptr, size_t size, Stream *stream) {
224-
auto maca_stream = GetMacaStream(stream);
225-
MACA_CHECK(mcMallocAsync(dev_ptr, size, maca_stream));
224+
// auto maca_stream = GetMacaStream(stream);
225+
// MACA_CHECK(mcMallocAsync(dev_ptr, size, maca_stream));
226+
Malloc(dev_ptr, size);
226227
}
227228

228229
void MacaGuardImpl::Free(void *dev_ptr) { MACA_CHECK(mcFree(dev_ptr)); }
229230

230231
void MacaGuardImpl::FreeAsync(void *dev_ptr, Stream *stream) {
231-
auto maca_stream = GetMacaStream(stream);
232-
MACA_CHECK(mcFreeAsync(dev_ptr, maca_stream));
232+
// auto maca_stream = GetMacaStream(stream);
233+
// MACA_CHECK(mcFreeAsync(dev_ptr, maca_stream));
234+
Free(dev_ptr);
233235
}
234236

235237
void MacaGuardImpl::Memcpy(void *dst, const void *src, size_t count, MemcpyKind kind) {

0 commit comments

Comments
 (0)