"...git@developer.sourcefind.cn:kecinstone/2024-pra-vllm.git" did not exist on "27ca23dc002e06eade014ac6b801dc2dcbea40f3"
Commit 121d9224 authored by tabuchixiangcai3's avatar tabuchixiangcai3
Browse files

[DCU]fix mip and compile issues


Signed-off-by: tabuchixiangcai3's avatarTangao <2205747538@qq.com>
parent ba058648
...@@ -432,7 +432,7 @@ def test_fuser_ops_with_userbuffers( ...@@ -432,7 +432,7 @@ def test_fuser_ops_with_userbuffers(
command = [] command = []
if tex.ubuf_built_with_mpi(): if tex.ubuf_built_with_mpi():
python_exe = pathlib.Path(sys.executable).resolve() python_exe = pathlib.Path(sys.executable).resolve()
command.extend(("mpirun", "-np", str(world_size), "--oversubscribe", "--quiet", python_exe)) command.extend(("mpirun", "-np", str(world_size), "--oversubscribe", "--allow-run-as-root", python_exe))
else: else:
command.extend(("torchrun", f"--nproc_per_node={world_size}")) command.extend(("torchrun", f"--nproc_per_node={world_size}"))
......
...@@ -44,7 +44,17 @@ __device__ __forceinline__ uint32_t bytewise_less_than(uint32_t a, uint32_t b) { ...@@ -44,7 +44,17 @@ __device__ __forceinline__ uint32_t bytewise_less_than(uint32_t a, uint32_t b) {
// Bitwise logical op to get answer in MSBs // Bitwise logical op to get answer in MSBs
// Equivalent logic: result = (a == b) ? !result : b // Equivalent logic: result = (a == b) ? !result : b
#ifdef __HIP_PLATFORM_AMD__ #ifdef __HIP_PLATFORM_AMD__
result = (a == b) ? !result : b; // Use HIP vector types for byte-wise parallel comparison
union { uint32_t u32; uint8_t bytes[4]; } a_union, b_union;
a_union.u32 = a;
b_union.u32 = b;
uint32_t mask = 0;
mask |= (a_union.bytes[0] < b_union.bytes[0]) ? 0x80000000U : 0;
mask |= (a_union.bytes[1] < b_union.bytes[1]) ? 0x00800000U : 0;
mask |= (a_union.bytes[2] < b_union.bytes[2]) ? 0x00008000U : 0;
mask |= (a_union.bytes[3] < b_union.bytes[3]) ? 0x00000080U : 0;
result = mask;
#else #else
asm("lop3.b32 %0, %1, %2, %3, 0x4D;\n\t" : "=r"(result) : "r"(a), "r"(b), "r"(result)); asm("lop3.b32 %0, %1, %2, %3, 0x4D;\n\t" : "=r"(result) : "r"(a), "r"(b), "r"(result));
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment