gemini-code-assist[bot] commented on code in PR #18455:
URL: https://github.com/apache/tvm/pull/18455#discussion_r2529581756


##########
tests/python/relax/test_codegen_cudnn.py:
##########
@@ -197,7 +197,9 @@ def test_conv2d_offload(data_shape, weight_shape, dtype, 
with_bias, activation):
         # see https://github.com/apache/tvm/pull/18319
         tvm.testing.assert_allclose(out, ref, rtol=3e-1, atol=3e-1)
     else:
-        tvm.testing.assert_allclose(out, ref, rtol=1e-2, atol=1e-2)
+        # Increased tolerance to 2.5e-2 to prevent flaky test due to numerical
+        # differences between cuDNN and LLVM implementations
+        tvm.testing.assert_allclose(out, ref, rtol=2.5e-2, atol=2.5e-2)

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   Using a magic number like `2.5e-2` can make the code harder to understand 
and maintain. It would be better to define this as a named constant at the 
module level, for example: `FLOAT32_CUDNN_LLVM_TOLERANCE = 2.5e-2`. This would 
clarify the purpose of the value and make it easier to reuse, for instance, in 
other tests that compare cuDNN and LLVM outputs.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to