<p dir="auto">Please:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Check for duplicate issues.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Provide a complete example of how to reproduce the bug, wrapped in triple backticks like this:</li>
</ul>
<p dir="auto">The following <a href="https://github.com/ska-sa/codex-africanus/blob/master/africanus/rime/jax/tests/test_jax_phase_delay.py">test case</a> has worked for a while, but has recently started failing. It seems that there isn't a constant handler for <code class="notranslate">complex64</code> anymore? The following reproducer demonstrates the issue, but replacing <code class="notranslate">out_dtype.type(1j)</code> with <code class="notranslate">1j</code> fixes the problem.</p>
<p dir="auto">This works on jax 0.2.26 and jaxlib 0.1.75, but fails on jax 0.2.27 and 0.1.76.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
import jax
import jax.numpy as jnp

@jax.jit
def phase_delay(lm, uvw, frequency):
    out_dtype = jnp.result_type(lm, uvw, frequency, np.complex64)

    one = lm.dtype.type(1.0)
    neg_two_pi_over_c = lm.dtype.type(-2*np.pi/3e8)

    l = lm[:, 0, None, None]  # noqa
    m = lm[:, 1, None, None]

    u = uvw[None, :, 0, None]
    v = uvw[None, :, 1, None]
    w = uvw[None, :, 2, None]

    n = jnp.sqrt(one - l**2 - m**2) - one

    real_phase = (neg_two_pi_over_c *
                  (l * u + m * v + n * w) *
                  frequency[None, None, :])
 
    # replacing out_dtype.type(1j) with 1j fixes this problem
    return jnp.exp(out_dtype.type(1j)*real_phase)

if __name__ == &quot;__main__&quot;:
    uvw = np.random.random(size=(100, 3)).astype(np.float32)
    lm = np.random.random(size=(10, 2)).astype(np.float32)*0.001
    frequency = np.linspace(.856e9, .856e9*2, 64).astype(np.float32)

    complex_phase = phase_delay(lm, uvw, frequency)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">jax</span>
<span class="pl-k">import</span> <span class="pl-s1">jax</span>.<span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">jnp</span>

<span class="pl-en">@<span class="pl-s1">jax</span>.<span class="pl-s1">jit</span></span>
<span class="pl-k">def</span> <span class="pl-en">phase_delay</span>(<span class="pl-s1">lm</span>, <span class="pl-s1">uvw</span>, <span class="pl-s1">frequency</span>):
    <span class="pl-s1">out_dtype</span> <span class="pl-c1">=</span> <span class="pl-s1">jnp</span>.<span class="pl-en">result_type</span>(<span class="pl-s1">lm</span>, <span class="pl-s1">uvw</span>, <span class="pl-s1">frequency</span>, <span class="pl-s1">np</span>.<span class="pl-s1">complex64</span>)

    <span class="pl-s1">one</span> <span class="pl-c1">=</span> <span class="pl-s1">lm</span>.<span class="pl-s1">dtype</span>.<span class="pl-en">type</span>(<span class="pl-c1">1.0</span>)
    <span class="pl-s1">neg_two_pi_over_c</span> <span class="pl-c1">=</span> <span class="pl-s1">lm</span>.<span class="pl-s1">dtype</span>.<span class="pl-en">type</span>(<span class="pl-c1">-</span><span class="pl-c1">2</span><span class="pl-c1">*</span><span class="pl-s1">np</span>.<span class="pl-s1">pi</span><span class="pl-c1">/</span><span class="pl-c1">3e8</span>)

    <span class="pl-s1">l</span> <span class="pl-c1">=</span> <span class="pl-s1">lm</span>[:, <span class="pl-c1">0</span>, <span class="pl-c1">None</span>, <span class="pl-c1">None</span>]  <span class="pl-c"># noqa</span>
    <span class="pl-s1">m</span> <span class="pl-c1">=</span> <span class="pl-s1">lm</span>[:, <span class="pl-c1">1</span>, <span class="pl-c1">None</span>, <span class="pl-c1">None</span>]

    <span class="pl-s1">u</span> <span class="pl-c1">=</span> <span class="pl-s1">uvw</span>[<span class="pl-c1">None</span>, :, <span class="pl-c1">0</span>, <span class="pl-c1">None</span>]
    <span class="pl-s1">v</span> <span class="pl-c1">=</span> <span class="pl-s1">uvw</span>[<span class="pl-c1">None</span>, :, <span class="pl-c1">1</span>, <span class="pl-c1">None</span>]
    <span class="pl-s1">w</span> <span class="pl-c1">=</span> <span class="pl-s1">uvw</span>[<span class="pl-c1">None</span>, :, <span class="pl-c1">2</span>, <span class="pl-c1">None</span>]

    <span class="pl-s1">n</span> <span class="pl-c1">=</span> <span class="pl-s1">jnp</span>.<span class="pl-en">sqrt</span>(<span class="pl-s1">one</span> <span class="pl-c1">-</span> <span class="pl-s1">l</span><span class="pl-c1">**</span><span class="pl-c1">2</span> <span class="pl-c1">-</span> <span class="pl-s1">m</span><span class="pl-c1">**</span><span class="pl-c1">2</span>) <span class="pl-c1">-</span> <span class="pl-s1">one</span>

    <span class="pl-s1">real_phase</span> <span class="pl-c1">=</span> (<span class="pl-s1">neg_two_pi_over_c</span> <span class="pl-c1">*</span>
                  (<span class="pl-s1">l</span> <span class="pl-c1">*</span> <span class="pl-s1">u</span> <span class="pl-c1">+</span> <span class="pl-s1">m</span> <span class="pl-c1">*</span> <span class="pl-s1">v</span> <span class="pl-c1">+</span> <span class="pl-s1">n</span> <span class="pl-c1">*</span> <span class="pl-s1">w</span>) <span class="pl-c1">*</span>
                  <span class="pl-s1">frequency</span>[<span class="pl-c1">None</span>, <span class="pl-c1">None</span>, :])
 
    <span class="pl-c"># replacing out_dtype.type(1j) with 1j fixes this problem</span>
    <span class="pl-k">return</span> <span class="pl-s1">jnp</span>.<span class="pl-en">exp</span>(<span class="pl-s1">out_dtype</span>.<span class="pl-en">type</span>(<span class="pl-c1">1j</span>)<span class="pl-c1">*</span><span class="pl-s1">real_phase</span>)

<span class="pl-k">if</span> <span class="pl-s1">__name__</span> <span class="pl-c1">==</span> <span class="pl-s">"__main__"</span>:
    <span class="pl-s1">uvw</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">random</span>(<span class="pl-s1">size</span><span class="pl-c1">=</span>(<span class="pl-c1">100</span>, <span class="pl-c1">3</span>)).<span class="pl-en">astype</span>(<span class="pl-s1">np</span>.<span class="pl-s1">float32</span>)
    <span class="pl-s1">lm</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">random</span>(<span class="pl-s1">size</span><span class="pl-c1">=</span>(<span class="pl-c1">10</span>, <span class="pl-c1">2</span>)).<span class="pl-en">astype</span>(<span class="pl-s1">np</span>.<span class="pl-s1">float32</span>)<span class="pl-c1">*</span><span class="pl-c1">0.001</span>
    <span class="pl-s1">frequency</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">linspace</span>(<span class="pl-c1">.856e9</span>, <span class="pl-c1">.856e9</span><span class="pl-c1">*</span><span class="pl-c1">2</span>, <span class="pl-c1">64</span>).<span class="pl-en">astype</span>(<span class="pl-s1">np</span>.<span class="pl-s1">float32</span>)

    <span class="pl-s1">complex_phase</span> <span class="pl-c1">=</span> <span class="pl-en">phase_delay</span>(<span class="pl-s1">lm</span>, <span class="pl-s1">uvw</span>, <span class="pl-s1">frequency</span>)</pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1119800143" data-permission-text="Title is private" data-url="https://github.com/google/jax/issues/9390" data-hovercard-type="issue" data-hovercard-url="/google/jax/issues/9390/hovercard" href="https://github.com/google/jax/issues/9390">#9390</a></li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python test_complex_constant_fail.py 
WARNING:absl:No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)
Traceback (most recent call last):
  File &quot;test_complex_constant_fail.py&quot;, line 32, in &lt;module&gt;
    complex_phase = phase_delay(lm, uvw, frequency)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/traceback_util.py&quot;, line 165, in reraise_with_filtered_traceback
    return fun(*args, **kwargs)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/api.py&quot;, line 429, in cache_miss
    donated_invars=donated_invars, inline=inline)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/core.py&quot;, line 1671, in bind
    return call_bind(self, fun, *args, **params)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/core.py&quot;, line 1683, in call_bind
    outs = top_trace.process_call(primitive, fun, tracers, params)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/core.py&quot;, line 596, in process_call
    return primitive.impl(f, *tracers, **params)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/dispatch.py&quot;, line 143, in _xla_call_impl
    *unsafe_map(arg_spec, args))
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/linear_util.py&quot;, line 272, in memoized_fun
    ans = call(fun, *args)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/dispatch.py&quot;, line 170, in _xla_callable_uncached
    *arg_specs).compile().unsafe_call
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/profiler.py&quot;, line 206, in wrapper
    return func(*args, **kwargs)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/dispatch.py&quot;, line 260, in lower_xla_callable
    donated_invars)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py&quot;, line 403, in lower_jaxpr_to_module
    input_output_aliases=input_output_aliases)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py&quot;, line 541, in lower_jaxpr_to_fun
    *args)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py&quot;, line 606, in jaxpr_subcomp
    in_nodes = map(read, eqn.invars)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/util.py&quot;, line 44, in safe_map
    return list(map(f, *args))
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py&quot;, line 583, in read
    return ir_constants(v.val, canonicalize_types=True)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py&quot;, line 171, in ir_constants
    raise TypeError(&quot;No constant handler for type: {}&quot;.format(type(val)))
jax._src.traceback_util.UnfilteredStackTrace: TypeError: No constant handler for type: &lt;class 'numpy.complex64'&gt;

The stack trace below excludes JAX-internal frames.
The preceding is the original exception that occurred, unmodified.

--------------------

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File &quot;test_complex_constant_fail.py&quot;, line 32, in &lt;module&gt;
    complex_phase = phase_delay(lm, uvw, frequency)
  File &quot;/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py&quot;, line 171, in ir_constants
    raise TypeError(&quot;No constant handler for type: {}&quot;.format(type(val)))
TypeError: No constant handler for type: &lt;class 'numpy.complex64'&gt;"><pre class="notranslate"><code class="notranslate">$ python test_complex_constant_fail.py 
WARNING:absl:No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)
Traceback (most recent call last):
  File "test_complex_constant_fail.py", line 32, in &lt;module&gt;
    complex_phase = phase_delay(lm, uvw, frequency)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/traceback_util.py", line 165, in reraise_with_filtered_traceback
    return fun(*args, **kwargs)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/api.py", line 429, in cache_miss
    donated_invars=donated_invars, inline=inline)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/core.py", line 1671, in bind
    return call_bind(self, fun, *args, **params)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/core.py", line 1683, in call_bind
    outs = top_trace.process_call(primitive, fun, tracers, params)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/core.py", line 596, in process_call
    return primitive.impl(f, *tracers, **params)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/dispatch.py", line 143, in _xla_call_impl
    *unsafe_map(arg_spec, args))
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/linear_util.py", line 272, in memoized_fun
    ans = call(fun, *args)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/dispatch.py", line 170, in _xla_callable_uncached
    *arg_specs).compile().unsafe_call
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/profiler.py", line 206, in wrapper
    return func(*args, **kwargs)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/dispatch.py", line 260, in lower_xla_callable
    donated_invars)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py", line 403, in lower_jaxpr_to_module
    input_output_aliases=input_output_aliases)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py", line 541, in lower_jaxpr_to_fun
    *args)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py", line 606, in jaxpr_subcomp
    in_nodes = map(read, eqn.invars)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/_src/util.py", line 44, in safe_map
    return list(map(f, *args))
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py", line 583, in read
    return ir_constants(v.val, canonicalize_types=True)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py", line 171, in ir_constants
    raise TypeError("No constant handler for type: {}".format(type(val)))
jax._src.traceback_util.UnfilteredStackTrace: TypeError: No constant handler for type: &lt;class 'numpy.complex64'&gt;

The stack trace below excludes JAX-internal frames.
The preceding is the original exception that occurred, unmodified.

--------------------

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "test_complex_constant_fail.py", line 32, in &lt;module&gt;
    complex_phase = phase_delay(lm, uvw, frequency)
  File "/home/sperkins/venv/afr/lib/python3.7/site-packages/jax/interpreters/mlir.py", line 171, in ir_constants
    raise TypeError("No constant handler for type: {}".format(type(val)))
TypeError: No constant handler for type: &lt;class 'numpy.complex64'&gt;
</code></pre></div>
<p dir="auto">Please:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Check for duplicate issues.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Provide a complete example of how to reproduce the bug, wrapped in triple backticks like this:</li>
</ul>
<ol dir="auto">
<li>Install jax v0.3.5 and CUDA-enabled jaxlib v0.3.0.</li>
<li>Run the test suite.</li>
<li>Observe the <code class="notranslate">cuSparseTest.test_coo_sorted_indices_gpu_lowerings</code> test to fail:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="=================================== FAILURES ===================================
______________ cuSparseTest.test_coo_sorted_indices_gpu_lowerings ______________
[gw0] linux -- Python 3.9.11 /nix/store/bvzpppawf2naqv3qhxqv66jxaq3iaxyj-python3-3.9.11/bin/python3.9

self = &lt;sparse_test.cuSparseTest testMethod=test_coo_sorted_indices_gpu_lowerings&gt;

    @unittest.skipIf(not GPU_LOWERING_ENABLED, &quot;test requires cusparse/hipsparse&quot;)
    @jtu.skip_on_devices(&quot;rocm&quot;)  # TODO(rocm): see SWDEV-328107
    def test_coo_sorted_indices_gpu_lowerings(self):
      dtype = jnp.float32

      mat = jnp.arange(12, dtype=dtype).reshape(4, 3)

      mat_rows_sorted = sparse.COO.fromdense(mat)
      self.assertTrue(mat_rows_sorted._rows_sorted)
      self.assertFalse(mat_rows_sorted._cols_sorted)

      mat_cols_sorted = sparse.COO.fromdense(mat.T).T
      self.assertFalse(mat_cols_sorted._rows_sorted)
      self.assertTrue(mat_cols_sorted._cols_sorted)

      mat_unsorted = sparse.COO(mat_rows_sorted._bufs, shape=mat_rows_sorted.shape)
      self.assertFalse(mat_unsorted._rows_sorted)
      self.assertFalse(mat_unsorted._cols_sorted)

      self.assertArraysEqual(mat, mat_rows_sorted._sort_rows().todense())
      self.assertArraysEqual(mat, mat_cols_sorted._sort_rows().todense())
      self.assertArraysEqual(mat, mat_unsorted._sort_rows().todense())

      todense = jit(sparse.coo_todense)
      with self.assertNoWarnings():
        dense_rows_sorted = todense(mat_rows_sorted)
        dense_cols_sorted = todense(mat_cols_sorted)
        dense_unsorted = todense(mat_unsorted._sort_rows())
      with self.assertWarnsRegex(sparse.CuSparseEfficiencyWarning, &quot;coo_todense GPU lowering requires matrices with sorted rows.*&quot;):
&gt;       dense_unsorted_fallback = todense(mat_unsorted)
E       AssertionError: CuSparseEfficiencyWarning not triggered

tests/sparse_test.py:473: AssertionError
=========================== short test summary info ============================
FAILED tests/sparse_test.py::cuSparseTest::test_coo_sorted_indices_gpu_lowerings
========== 1 failed, 14145 passed, 1487 skipped in 165.49s (0:02:45) ===========
error: builder for '/nix/store/bk64c49429aj73wkz4dijlf15h0l2v9r-python3.9-jax-0.3.5.drv' failed with exit code 1;
       last 10 log lines:
       &gt;         dense_cols_sorted = todense(mat_cols_sorted)
       &gt;         dense_unsorted = todense(mat_unsorted._sort_rows())
       &gt;       with self.assertWarnsRegex(sparse.CuSparseEfficiencyWarning, &quot;coo_todense GPU lowering requires matrices with sorted rows.*&quot;):
       &gt; &gt;       dense_unsorted_fallback = todense(mat_unsorted)
       &gt; E       AssertionError: CuSparseEfficiencyWarning not triggered
       &gt;
       &gt; tests/sparse_test.py:473: AssertionError
       &gt; =========================== short test summary info ============================
       &gt; FAILED tests/sparse_test.py::cuSparseTest::test_coo_sorted_indices_gpu_lowerings
       &gt; ========== 1 failed, 14145 passed, 1487 skipped in 165.49s (0:02:45) ==========="><pre class="notranslate"><code class="notranslate">=================================== FAILURES ===================================
______________ cuSparseTest.test_coo_sorted_indices_gpu_lowerings ______________
[gw0] linux -- Python 3.9.11 /nix/store/bvzpppawf2naqv3qhxqv66jxaq3iaxyj-python3-3.9.11/bin/python3.9

self = &lt;sparse_test.cuSparseTest testMethod=test_coo_sorted_indices_gpu_lowerings&gt;

    @unittest.skipIf(not GPU_LOWERING_ENABLED, "test requires cusparse/hipsparse")
    @jtu.skip_on_devices("rocm")  # TODO(rocm): see SWDEV-328107
    def test_coo_sorted_indices_gpu_lowerings(self):
      dtype = jnp.float32

      mat = jnp.arange(12, dtype=dtype).reshape(4, 3)

      mat_rows_sorted = sparse.COO.fromdense(mat)
      self.assertTrue(mat_rows_sorted._rows_sorted)
      self.assertFalse(mat_rows_sorted._cols_sorted)

      mat_cols_sorted = sparse.COO.fromdense(mat.T).T
      self.assertFalse(mat_cols_sorted._rows_sorted)
      self.assertTrue(mat_cols_sorted._cols_sorted)

      mat_unsorted = sparse.COO(mat_rows_sorted._bufs, shape=mat_rows_sorted.shape)
      self.assertFalse(mat_unsorted._rows_sorted)
      self.assertFalse(mat_unsorted._cols_sorted)

      self.assertArraysEqual(mat, mat_rows_sorted._sort_rows().todense())
      self.assertArraysEqual(mat, mat_cols_sorted._sort_rows().todense())
      self.assertArraysEqual(mat, mat_unsorted._sort_rows().todense())

      todense = jit(sparse.coo_todense)
      with self.assertNoWarnings():
        dense_rows_sorted = todense(mat_rows_sorted)
        dense_cols_sorted = todense(mat_cols_sorted)
        dense_unsorted = todense(mat_unsorted._sort_rows())
      with self.assertWarnsRegex(sparse.CuSparseEfficiencyWarning, "coo_todense GPU lowering requires matrices with sorted rows.*"):
&gt;       dense_unsorted_fallback = todense(mat_unsorted)
E       AssertionError: CuSparseEfficiencyWarning not triggered

tests/sparse_test.py:473: AssertionError
=========================== short test summary info ============================
FAILED tests/sparse_test.py::cuSparseTest::test_coo_sorted_indices_gpu_lowerings
========== 1 failed, 14145 passed, 1487 skipped in 165.49s (0:02:45) ===========
error: builder for '/nix/store/bk64c49429aj73wkz4dijlf15h0l2v9r-python3.9-jax-0.3.5.drv' failed with exit code 1;
       last 10 log lines:
       &gt;         dense_cols_sorted = todense(mat_cols_sorted)
       &gt;         dense_unsorted = todense(mat_unsorted._sort_rows())
       &gt;       with self.assertWarnsRegex(sparse.CuSparseEfficiencyWarning, "coo_todense GPU lowering requires matrices with sorted rows.*"):
       &gt; &gt;       dense_unsorted_fallback = todense(mat_unsorted)
       &gt; E       AssertionError: CuSparseEfficiencyWarning not triggered
       &gt;
       &gt; tests/sparse_test.py:473: AssertionError
       &gt; =========================== short test summary info ============================
       &gt; FAILED tests/sparse_test.py::cuSparseTest::test_coo_sorted_indices_gpu_lowerings
       &gt; ========== 1 failed, 14145 passed, 1487 skipped in 165.49s (0:02:45) ===========
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> If applicable, include full error messages/tracebacks.</li>
</ul>
<p dir="auto">Why isn't this test skipped when running on a machine without access to a GPU?</p>