gpu_ptr_encoding test fails during make test_rust but passes 5/5 times in isolation — test-ordering or GPU-state-pollution issue

Open
#1,332 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
testing-qa

Research direction

Start with qdp/qdp-core/tests/gpu_ptr_encoding.rs:795 and reproduce the failure with make test_rust. Run the gpu_ptr_encoding test with --test-threads=1, then use --skip to bisect for state pollution while checking the non-default-stream setup and synchronization described in the issue. Done means the full Rust test suite passes reliably and the isolation-only failure is explained and resolved.

Written by the indexing model from the issue text.

Description

bug
Summary

test_encode_from_gpu_ptr_f32_with_stream_non_default_success (in qdp/qdp-core/tests/gpu_ptr_encoding.rs:795) fails reproducibly during full make test_rust runs, but passes 5/5 times when run in isolation. Suggests a test-isolation issue (GPU state pollution from preceding tests, or a synchronization gap exposed only under specific test ordering) rather than a defect in the f32-non-default-stream code path itself.

Failure observed
thread 'test_encode_from_gpu_ptr_f32_with_stream_non_default_success' panicked at
qdp-core/tests/gpu_ptr_encoding.rs:795:14:
encode_from_gpu_ptr_f32_with_stream (non-default stream):
    InvalidInput("Input data (f32) has zero or non-finite norm
                  (contains NaN, Inf, or all zeros)")

The other 63 tests in gpu_ptr_encoding (including test_encode_from_gpu_ptr_f32_with_stream_success on the default stream) pass.

Reproducer
git checkout mahout-qumat-0.6.0-RC2
export CXX=g++-13 QDP_CUDA_ARCH_LIST=61+PTX
 
# Fails consistently as part of the full Rust suite
make test_rust    # 1 failure: test_encode_from_gpu_ptr_f32_with_stream_non_default_success
 
# Passes consistently in isolation
cd qdp
for i in 1 2 3 4 5; do
  cargo test -p qdp-core --test gpu_ptr_encoding -- \
    test_encode_from_gpu_ptr_f32_with_stream_non_default_success --exact 2>&1 | tail -1
done
# test result: ok. 1 passed; 0 failed (×5)
Likely causes (worth investigating in order)
  1. Test ordering / state pollution. A preceding test in gpu_ptr_encoding (or in another test binary linked into the same process if cargo-test reuses one) leaves GPU memory or stream state in a configuration that breaks the non-default-stream input setup. Try running gpu_ptr_encoding with --test-threads=1 and bisecting via --skip to find the polluting test.
  2. Missing synchronization in the test harness. The test creates an input buffer on a user-provided stream, then calls the encoder which reads the norm — possibly on a different stream — without a cudaStreamSynchronize or event ordering between the two. Under high GPU load (full suite), the encoder reads before the buffer is populated.
  3. Encoder bug with non-default stream. Less likely given isolation passes, but if (1) and (2) rule out, the encoder may be assuming default-stream semantics in some f32 path.
Environment
  • OS: Ubuntu 24.04
  • CUDA Toolkit: 12.4
  • GPU: NVIDIA GeForce GTX 1060 with Max-Q Design (sm_61)
  • Rust: stable, compiled with CXX=g++-13 (CUDA 12.4 rejects gcc 14)
  • Arch list: QDP_CUDA_ARCH_LIST=61+PTX
Dominant language
Rust
Stars
2.3k
Forks
1k
Avg merge
2d 20h
Merged PRs (30d)
7

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/mahout

All issues in apache/mahout

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.