Skip to content

Commit

Permalink
Fixes SWDEV-483388 (#74)
Browse files Browse the repository at this point in the history
* Fix SWDEV-483388: mistakenly invoke hipMemcpy when ORT_ENABLE_STREAM=True

* Fix another hipMemcpy

* Remove MIGRAPHX_STREAM_SYNC guard which does not exists in current version.
  • Loading branch information
xinyazhang authored and Ted Themistokleous committed Jan 2, 2025
1 parent ccc4224 commit a3632b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions onnxruntime/core/providers/migraphx/gpu_data_transfer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ common::Status GPUDataTransfer::CopyTensorAsync(const Tensor& src, Tensor& dst,
} else if (src_device.Type() == OrtDevice::GPU) {
// copying between GPU, this is non-blocking
HIP_CALL_THROW(hipMemcpyAsync(dst_data, src_data, bytes, hipMemcpyDeviceToDevice, static_cast<hipStream_t>(stream.GetHandle())));
} else {
// copy from other CPU memory to GPU, this is blocking
HIP_CALL_THROW(hipMemcpyWithStream(dst_data, src_data, bytes, hipMemcpyHostToDevice, static_cast<hipStream_t>(stream.GetHandle())));
}
} else if (src_device.Type() == OrtDevice::GPU) {
// If dest are not pinned, the memory copy will be performed synchronously.
Expand Down

0 comments on commit a3632b0

Please sign in to comment.