rich7420 commented on code in PR #1389:
URL: https://github.com/apache/mahout/pull/1389#discussion_r3620192259


##########
qdp/qdp-kernels/build.rs:
##########
@@ -26,9 +26,9 @@
 use std::env;
 use std::process::Command;
 
-const DEFAULT_CUBIN_ARCHES: &[&str] = &["75", "80", "86", "89", "90", "100", 
"120"];
-const DEFAULT_PTX_CANDIDATES: &[&str] = &["120", "100", "90", "89", "86", 
"80", "75"];
-const LEGACY_FALLBACK_ARCHES: &[&str] = &["75", "80", "86"];
+const DEFAULT_CUBIN_ARCHES: &[&str] = &["80", "86", "89", "90", "100", "120"];
+const DEFAULT_PTX_CANDIDATES: &[&str] = &["120", "100", "90", "89", "86", 
"80"];
+const LEGACY_FALLBACK_ARCHES: &[&str] = &["80", "86"];

Review Comment:
   Hey, I actually built this and ran the test suite on a real Turing card (RTX 
2080 Ti, sm_75), and this line is the source of a pretty serious regression. 
`"75"` got dropped from all three of these lists (`DEFAULT_CUBIN_ARCHES`, 
`DEFAULT_PTX_CANDIDATES`, `LEGACY_FALLBACK_ARCHES`). Since every kernel file in 
this crate is compiled through a single shared `cc::Build`, this doesn't just 
affect the new tensor-core kernels — it silently drops sm_75 SASS/PTX for all 
the pre-existing, unrelated kernels too (`iqp.cu`, `amplitude.cu`, `phase.cu`, 
etc). That reverts Turing support that was explicitly added back in #731.
   
   Concretely: on `main`, `cargo test -p qdp-core --test gpu_iqp_encoding` 
passes 22/22 on this GPU. On this branch, the same test fails 12/22 with `CUDA 
error 500` (invalid device function). Even the verification command you listed 
in the PR description, `cargo test --workspace --exclude qdp-python --lib`, 
fails on this hardware for me (`test_stream_encode_end_to_end`), so I don't 
think it was actually run against a Turing GPU.
   
   I get why this happened though — `ImplicitHadamardOzaki.cu` uses inline PTX 
`mma.sync.aligned.m16n8k32...s8` which genuinely requires sm_80+ (I confirmed 
with `nvcc -arch=sm_75` — it fails with `Feature '.m16n8k32' requires .target 
sm_80 or higher`). So the *new* Ozaki files can't target sm_75, that part's 
real. But the fix should be to compile those specific files with their own 
sm_80+-only flags/build object, not lower the floor for the whole crate.



##########
testing/qdp/test_iqp_tc_path.py:
##########
@@ -0,0 +1,102 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Smoke and normalization tests for FWT vs Tensor Core IQP paths (GPU vs 
GPU)."""
+
+import pytest
+import torch
+from qumat_qdp import QdpEngine
+
+
+def _iqp_param_count(num_qubits: int) -> int:
+    return num_qubits + num_qubits * (num_qubits - 1) // 2
+
+
[email protected](scope="module")
+def engine():
+    try:
+        eng = QdpEngine(device_id=0, precision="float64")
+    except Exception as exc:
+        pytest.skip(f"Could not initialize QdpEngine: {exc}")
+    if not hasattr(eng, "encode_batch_tc"):
+        pytest.skip("encode_batch_tc not available in this build")

Review Comment:
   One more thing worth flagging: this is the *only* test coverage that 
exercises `encode_batch_tc`/`launch_iqp_encode_tc` at all — there's no 
Rust-level unit or integration test for it anywhere in `qdp-core/tests`. And 
because this whole module skips itself the moment `hasattr(eng, 
"encode_batch_tc")` is false, if CI ever builds without CUDA (or the CUDA build 
silently fails for an architecture, like in the build.rs comment above), this 
test file just reports as skipped instead of failing loudly. So there's 
currently no safety net that would have caught the sm_75 regression.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to