Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix fp8 in buffercomparator #70

Open
wants to merge 1 commit into
base: rocm-jaxlib-v0.4.31-qa
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions xla/service/gpu/buffer_comparator.cu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ __global__ void xla_fp8_e4m3fnuz_comparison(__hip_fp8_storage_t* buffer_a,
float rel_error_threshold,
uint64_t buffer_length,
int* mismatch_count) {
#if (defined(__gfx940__) || defined(__gfx941__) || defined(__gfx942__))
int mcount = 0;
uint64_t unroll = 128 / sizeof(*buffer_a);
uint64_t idx = (threadIdx.x + blockIdx.x * blockDim.x) * unroll;
Expand All @@ -130,13 +131,17 @@ __global__ void xla_fp8_e4m3fnuz_comparison(__hip_fp8_storage_t* buffer_a,
}
if (mcount)
atomicAdd(mismatch_count, mcount);
#else
abort();
#endif // defined(__gfx940__) || defined(__gfx941__) || defined(__gfx942__)
}

__global__ void xla_fp8_e5m2fnuz_comparison(__hip_fp8_storage_t* buffer_a,
__hip_fp8_storage_t* buffer_b,
float rel_error_threshold,
uint64_t buffer_length,
int* mismatch_count) {
#if (defined(__gfx940__) || defined(__gfx941__) || defined(__gfx942__))
int mcount = 0;
uint64_t unroll = 128 / sizeof(*buffer_a);
uint64_t idx = (threadIdx.x + blockIdx.x * blockDim.x) * unroll;
Expand All @@ -159,6 +164,9 @@ __global__ void xla_fp8_e5m2fnuz_comparison(__hip_fp8_storage_t* buffer_a,
}
if (mcount)
atomicAdd(mismatch_count, mcount);
#else
abort();
#endif // defined(__gfx940__) || defined(__gfx941__) || defined(__gfx942__)
}
#endif // TENSORFLOW_USE_ROCM && TF_ROCM_VERSION >= 60200

Expand Down
Loading