{
  "id": 485864,
  "title": "SSM Architecture Exploration",
  "url": "/competitions/hms-harmful-brain-activity-classification/discussion/485864",
  "author_name": "",
  "post_date": "2024-03-22T14:33:45.407486600Z",
  "votes": 1,
  "comment_count": 7,
  "views": 0,
  "content": "<p>Has anyone tried SSM architecture models like Mamba? How's the performance? I was able to train one mamba model locally with a decent CV but couldn't get it running on a Kaggle notebook yet.</p>",
  "messages": [
    {
      "id": "2710771",
      "postDate": "03/22/2024 14:33:45",
      "content": "<p>Has anyone tried SSM architecture models like Mamba? How's the performance? I was able to train one mamba model locally with a decent CV but couldn't get it running on a Kaggle notebook yet.</p>",
      "rawMarkdown": "Has anyone tried SSM architecture models like Mamba? How's the performance? I was able to train one mamba model locally with a decent CV but couldn't get it running on a Kaggle notebook yet.",
      "votes": null
    },
    {
      "id": "2711420",
      "postDate": "03/22/2024 21:01:54",
      "content": "<p>I have yet to see a Kaggle competition in which Mamba beats transformer. When I do, I will start to believe in Mamba—good luck, haha. Well, as I understand it, Mamba's main selling point is fast inference, so unless inference time is a problem (in this competition, it's not), there is apparently no reason to use Mamba over pure transformer(?).</p>",
      "rawMarkdown": "I have yet to see a Kaggle competition in which Mamba beats transformer. When I do, I will start to believe in Mamba—good luck, haha. Well, as I understand it, Mamba's main selling point is fast inference, so unless inference time is a problem (in this competition, it's not), there is apparently no reason to use Mamba over pure transformer(?).",
      "votes": null
    },
    {
      "id": "2711753",
      "postDate": "03/23/2024 03:45:15",
      "content": "<p>Haven't tried it yet, <br>\nif you share what are obstacles to run on kaggle </p>",
      "rawMarkdown": "Haven't tried it yet, \nif you share what are obstacles to run on kaggle",
      "votes": null
    },
    {
      "id": "2711772",
      "postDate": "03/23/2024 04:10:56",
      "content": "<p>I will try mamba :v</p>",
      "rawMarkdown": "I will try mamba :v",
      "votes": null
    },
    {
      "id": "2712406",
      "postDate": "03/23/2024 14:42:36",
      "content": "<p>Yeah that's a good point! Although I think there's a potential for Mamba models considering it's still relatively new compared to the transformer models. :)</p>",
      "rawMarkdown": "Yeah that's a good point! Although I think there's a potential for Mamba models considering it's still relatively new compared to the transformer models. :)",
      "votes": null
    },
    {
      "id": "2712408",
      "postDate": "03/23/2024 14:43:00",
      "content": "<p>Awesome, can you please share the performance when you tested it? Thanks!</p>",
      "rawMarkdown": "Awesome, can you please share the performance when you tested it? Thanks!",
      "votes": null
    },
    {
      "id": "2712435",
      "postDate": "03/23/2024 14:55:37",
      "content": "<p>This is what I got, it seems it has to do something with the selective scan function from the mamba package</p>\n<pre><code>File /kaggle/input/mamba-v1/MedMamba.py:, in SS2D.forward_corev0(, x)\n     As = -torch.exp(.A_logs.()).view(, .d_state)  # (k * d, d_state)\n     dt_projs_bias = .dt_projs_bias.().view() # (k * d)\n--&gt;  out_y = .selective_scan(\n         xs, dts, \n         As, Bs, Cs, Ds, z=None,\n         delta_bias=dt_projs_bias,\n         delta_softplus=True,\n         return_last_state=False,\n     ).view(B, K, , L)\n     assert out_y.dtype == torch.\n     inv_y = torch.flip(out_y[:, :], dims=[]).view(B, , , L)\n\nFile /opt/conda/lib/python3/site-packages/mamba_ssm/ops/selective_scan_interface.py:, in selective_scan_fn(u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n      def selective_scan_fn(u, delta, A, B, C, D=None, z=None, delta_bias=None, delta_softplus=False,\n                           return_last_state=False):\n          \n---&gt;       SelectiveScanFn.apply(u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n\nFile /opt/conda/lib/python3/site-packages/torch/autograd/.py:, in Function.apply(cls, *args, **kwargs)\n      not torch._C._are_functorch_transforms_active():\n         # See NOTE: [functorch vjp and autograd interaction]\n         args = _functorch.utils.unwrap_dead_wrappers(args)\n--&gt;       super().apply(*args, **kwargs)  # type: ignore[misc]\n      cls.setup_context == _SingleLevelFunction.setup_context:\n         raise RuntimeError(\n             \n             \n             \n             \n         )\n\nFile /opt/conda/lib/python3/site-packages/mamba_ssm/ops/selective_scan_interface.py:, in SelectiveScanFn.forward(ctx, u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n          C = rearrange(C, )\n          ctx.squeeze_C = True\n---&gt;  out, x, *rest = selective_scan_cuda.fwd(u, delta, A, B, C, D, z, delta_bias, delta_softplus)\n      ctx.delta_softplus = delta_softplus\n      ctx.has_z = z is not None\n\nRuntimeError: CUDA error: no kernel image is available  execution on the device\nCUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.\nFor debugging consider passing CUDA_LAUNCH_BLOCKING=\nCompile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.\n\n raised from c10_cuda_check_implementation at /usr/local/src/pytorch/c10/cuda/CUDAException.cpp: (most recent call first):\nframe #: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string&lt;, std::char_traits&lt;&gt;, std::allocator&lt;&gt; &gt;) +  ( in /opt/conda/lib/python3/site-packages/torch/lib/libc10.so)\nframe #: c10::detail::torchCheckFail( *,  *,  , std::__cxx11::basic_string&lt;, std::char_traits&lt;&gt;, std::allocator&lt;&gt; &gt; &amp;) +  ( in /opt/conda/lib/python3/site-packages/torch/lib/libc10.so)\nframe #: c10::cuda::c10_cuda_check_implementation(,  *,  *, , ) +  ( in /opt/conda/lib/python3/site-packages/torch/lib/libc10_cuda.so)\nframe #: selective_scan_fwd_launch&lt;, , , &gt;(SSMParamsBase&amp;, CUstream_st*)::{lambda()#}::operator()() ::{lambda()#}::operator()() ::{lambda()#}::operator()() ::{lambda()#}::operator()() ::{lambda()#}::operator()()  +  ( in /opt/conda/lib/python3/site-packages/selective_scan_cuda.cpython-x86_64-linux-gnu.so)\nframe #: void selective_scan_fwd_cuda&lt;, &gt;(SSMParamsBase&amp;, CUstream_st*) +  ( in /opt/conda/lib/python3/site-packages/selective_scan_cuda.cpython-x86_64-linux-gnu.so)\nframe #: selective_scan_fwd(at::Tensor &amp;, at::Tensor &amp;, at::Tensor &amp;, at::Tensor &amp;, at::Tensor &amp;, c10::optional&lt;at::Tensor&gt; &amp;, c10::optional&lt;at::Tensor&gt; &amp;, c10::optional&lt;at::Tensor&gt; &amp;, ) +  ( in /opt/conda/lib/python3/site-packages/selective_scan_cuda.cpython-x86_64-linux-gnu.so)\nframe #: &lt;unknown </code></pre>",
      "rawMarkdown": "This is what I got, it seems it has to do something with the selective scan function from the mamba package\n\n```\nFile /kaggle/input/mamba-v1-2/MedMamba.py:402, in SS2D.forward_corev0(self, x)\n    399 As = -torch.exp(self.A_logs.float()).view(-1, self.d_state)  # (k * d, d_state)\n    400 dt_projs_bias = self.dt_projs_bias.float().view(-1) # (k * d)\n--> 402 out_y = self.selective_scan(\n    403     xs, dts, \n    404     As, Bs, Cs, Ds, z=None,\n    405     delta_bias=dt_projs_bias,\n    406     delta_softplus=True,\n    407     return_last_state=False,\n    408 ).view(B, K, -1, L)\n    409 assert out_y.dtype == torch.float\n    411 inv_y = torch.flip(out_y[:, 2:4], dims=[-1]).view(B, 2, -1, L)\n\nFile /opt/conda/lib/python3.10/site-packages/mamba_ssm/ops/selective_scan_interface.py:88, in selective_scan_fn(u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n     82 def selective_scan_fn(u, delta, A, B, C, D=None, z=None, delta_bias=None, delta_softplus=False,\n     83                      return_last_state=False):\n     84     \"\"\"if return_last_state is True, returns (out, last_state)\n     85     last_state has shape (batch, dim, dstate). Note that the gradient of the last state is\n     86     not considered in the backward pass.\n     87     \"\"\"\n---> 88     return SelectiveScanFn.apply(u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n\nFile /opt/conda/lib/python3.10/site-packages/torch/autograd/function.py:539, in Function.apply(cls, *args, **kwargs)\n    536 if not torch._C._are_functorch_transforms_active():\n    537     # See NOTE: [functorch vjp and autograd interaction]\n    538     args = _functorch.utils.unwrap_dead_wrappers(args)\n--> 539     return super().apply(*args, **kwargs)  # type: ignore[misc]\n    541 if cls.setup_context == _SingleLevelFunction.setup_context:\n    542     raise RuntimeError(\n    543         \"In order to use an autograd.Function with functorch transforms \"\n    544         \"(vmap, grad, jvp, jacrev, ...), it must override the setup_context \"\n    545         \"staticmethod. For more details, please see \"\n    546         \"https://pytorch.org/docs/master/notes/extending.func.html\"\n    547     )\n\nFile /opt/conda/lib/python3.10/site-packages/mamba_ssm/ops/selective_scan_interface.py:42, in SelectiveScanFn.forward(ctx, u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n     40     C = rearrange(C, \"b dstate l -> b 1 dstate l\")\n     41     ctx.squeeze_C = True\n---> 42 out, x, *rest = selective_scan_cuda.fwd(u, delta, A, B, C, D, z, delta_bias, delta_softplus)\n     43 ctx.delta_softplus = delta_softplus\n     44 ctx.has_z = z is not None\n\nRuntimeError: CUDA error: no kernel image is available for execution on the device\nCUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.\nFor debugging consider passing CUDA_LAUNCH_BLOCKING=1.\nCompile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.\n\nException raised from c10_cuda_check_implementation at /usr/local/src/pytorch/c10/cuda/CUDAException.cpp:44 (most recent call first):\nframe #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x6c (0x78ad0cf4151c in /opt/conda/lib/python3.10/site-packages/torch/lib/libc10.so)\nframe #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0xfa (0x78ad0cef69f0 in /opt/conda/lib/python3.10/site-packages/torch/lib/libc10.so)\nframe #2: c10::cuda::c10_cuda_check_implementation(int, char const*, char const*, int, bool) + 0x3cc (0x78ad0cfe601c in /opt/conda/lib/python3.10/site-packages/torch/lib/libc10_cuda.so)\nframe #3: selective_scan_fwd_launch<128, 16, float, float>(SSMParamsBase&, CUstream_st*)::{lambda()#1}::operator()() const::{lambda()#1}::operator()() const::{lambda()#1}::operator()() const::{lambda()#1}::operator()() const::{lambda()#1}::operator()() const + 0x20e (0x78acb3238e6e in /opt/conda/lib/python3.10/site-packages/selective_scan_cuda.cpython-310-x86_64-linux-gnu.so)\nframe #4: void selective_scan_fwd_cuda<float, float>(SSMParamsBase&, CUstream_st*) + 0x21c (0x78acb323a65c in /opt/conda/lib/python3.10/site-packages/selective_scan_cuda.cpython-310-x86_64-linux-gnu.so)\nframe #5: selective_scan_fwd(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::optional<at::Tensor> const&, c10::optional<at::Tensor> const&, c10::optional<at::Tensor> const&, bool) + 0x13b4 (0x78acb31890f4 in /opt/conda/lib/python3.10/site-packages/selective_scan_cuda.cpython-310-x86_64-linux-gnu.so)\nframe #6: <unknown function> + 0x8e574 (0x78acb319b574 in /opt/conda/lib/python3.10/site-packages/selective_scan_cuda.cpython-310-x86_64-linux-gnu.so)\nframe #7: <unknown function> + 0x8b93f (0x78acb319893f in /opt/conda/lib/python3.10/site-packages/selective_scan_cuda.cpython-310-x86_64-linux-gnu.so)\nframe #8: <unknown function> + 0x144446 (0x5a7dd967a446 in /opt/conda/bin/python)\nframe #9: _PyObject_MakeTpCall + 0x26b (0x5a7dd967397b in /opt/conda/bin/python)\nframe #10: _PyEval_EvalFrameDefault + 0x54b6 (0x5a7dd966f8c6 in /opt/conda/bin/python)\nframe #11: _PyFunction_Vectorcall + 0x6c (0x5a7dd967a8cc in /opt/conda/bin/python)\nframe #12: THPFunction_apply(_object*, _object*) + 0x1048 (0x78ad4d4050b8 in /opt/conda/lib/python3.10/site-packages/torch/lib/libtorch_python.so)\nframe #13: <unknown function> + 0x144468 (0x5a7dd967a468 in /opt/conda/bin/python)\nframe #14: PyObject_Call + 0x207 (0x5a7dd9686ee7 in /opt/conda/bin/python)\nframe #15: _PyEval_EvalFrameDefault + 0x5d5d (0x5a7dd967016d in /opt/conda/bin/python)\nframe #16: <unknown function> + 0x150402 (0x5a7dd9686402 in /opt/conda/bin/python)\nframe #17: _PyEval_EvalFrameDefault + 0x4c12 (0x5a7dd966f022 in /opt/conda/bin/python)\nframe #18: _PyFunction_Vectorcall + 0x6c (0x5a7dd967a8cc in /opt/conda/bin/python)\n```",
      "votes": null
    },
    {
      "id": "2814647",
      "postDate": "05/15/2024 13:20:01",
      "content": "<p>Hi, I am facing a similar issue and was wondering if you had any luck fixing it (or finding a workaround). </p>",
      "rawMarkdown": "Hi, I am facing a similar issue and was wondering if you had any luck fixing it (or finding a workaround).",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2711420,
      "author_name": "shlomoron",
      "author_url": "",
      "post_date": "03/22/2024 21:01:54",
      "content": "<p>I have yet to see a Kaggle competition in which Mamba beats transformer. When I do, I will start to believe in Mamba—good luck, haha. Well, as I understand it, Mamba's main selling point is fast inference, so unless inference time is a problem (in this competition, it's not), there is apparently no reason to use Mamba over pure transformer(?).</p>",
      "votes": null,
      "replies": [
        {
          "id": 2712406,
          "author_name": "yyyu54",
          "author_url": "",
          "post_date": "03/23/2024 14:42:36",
          "content": "<p>Yeah that's a good point! Although I think there's a potential for Mamba models considering it's still relatively new compared to the transformer models. :)</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2711753,
      "author_name": "letemoin",
      "author_url": "",
      "post_date": "03/23/2024 03:45:15",
      "content": "<p>Haven't tried it yet, <br>\nif you share what are obstacles to run on kaggle </p>",
      "votes": null,
      "replies": [
        {
          "id": 2712435,
          "author_name": "yyyu54",
          "author_url": "",
          "post_date": "03/23/2024 14:55:37",
          "content": "<p>This is what I got, it seems it has to do something with the selective scan function from the mamba package</p>\n<pre><code>File /kaggle/input/mamba-v1/MedMamba.py:, in SS2D.forward_corev0(, x)\n     As = -torch.exp(.A_logs.()).view(, .d_state)  # (k * d, d_state)\n     dt_projs_bias = .dt_projs_bias.().view() # (k * d)\n--&gt;  out_y = .selective_scan(\n         xs, dts, \n         As, Bs, Cs, Ds, z=None,\n         delta_bias=dt_projs_bias,\n         delta_softplus=True,\n         return_last_state=False,\n     ).view(B, K, , L)\n     assert out_y.dtype == torch.\n     inv_y = torch.flip(out_y[:, :], dims=[]).view(B, , , L)\n\nFile /opt/conda/lib/python3/site-packages/mamba_ssm/ops/selective_scan_interface.py:, in selective_scan_fn(u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n      def selective_scan_fn(u, delta, A, B, C, D=None, z=None, delta_bias=None, delta_softplus=False,\n                           return_last_state=False):\n          \n---&gt;       SelectiveScanFn.apply(u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n\nFile /opt/conda/lib/python3/site-packages/torch/autograd/.py:, in Function.apply(cls, *args, **kwargs)\n      not torch._C._are_functorch_transforms_active():\n         # See NOTE: [functorch vjp and autograd interaction]\n         args = _functorch.utils.unwrap_dead_wrappers(args)\n--&gt;       super().apply(*args, **kwargs)  # type: ignore[misc]\n      cls.setup_context == _SingleLevelFunction.setup_context:\n         raise RuntimeError(\n             \n             \n             \n             \n         )\n\nFile /opt/conda/lib/python3/site-packages/mamba_ssm/ops/selective_scan_interface.py:, in SelectiveScanFn.forward(ctx, u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n          C = rearrange(C, )\n          ctx.squeeze_C = True\n---&gt;  out, x, *rest = selective_scan_cuda.fwd(u, delta, A, B, C, D, z, delta_bias, delta_softplus)\n      ctx.delta_softplus = delta_softplus\n      ctx.has_z = z is not None\n\nRuntimeError: CUDA error: no kernel image is available  execution on the device\nCUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.\nFor debugging consider passing CUDA_LAUNCH_BLOCKING=\nCompile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.\n\n raised from c10_cuda_check_implementation at /usr/local/src/pytorch/c10/cuda/CUDAException.cpp: (most recent call first):\nframe #: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string&lt;, std::char_traits&lt;&gt;, std::allocator&lt;&gt; &gt;) +  ( in /opt/conda/lib/python3/site-packages/torch/lib/libc10.so)\nframe #: c10::detail::torchCheckFail( *,  *,  , std::__cxx11::basic_string&lt;, std::char_traits&lt;&gt;, std::allocator&lt;&gt; &gt; &amp;) +  ( in /opt/conda/lib/python3/site-packages/torch/lib/libc10.so)\nframe #: c10::cuda::c10_cuda_check_implementation(,  *,  *, , ) +  ( in /opt/conda/lib/python3/site-packages/torch/lib/libc10_cuda.so)\nframe #: selective_scan_fwd_launch&lt;, , , &gt;(SSMParamsBase&amp;, CUstream_st*)::{lambda()#}::operator()() ::{lambda()#}::operator()() ::{lambda()#}::operator()() ::{lambda()#}::operator()() ::{lambda()#}::operator()()  +  ( in /opt/conda/lib/python3/site-packages/selective_scan_cuda.cpython-x86_64-linux-gnu.so)\nframe #: void selective_scan_fwd_cuda&lt;, &gt;(SSMParamsBase&amp;, CUstream_st*) +  ( in /opt/conda/lib/python3/site-packages/selective_scan_cuda.cpython-x86_64-linux-gnu.so)\nframe #: selective_scan_fwd(at::Tensor &amp;, at::Tensor &amp;, at::Tensor &amp;, at::Tensor &amp;, at::Tensor &amp;, c10::optional&lt;at::Tensor&gt; &amp;, c10::optional&lt;at::Tensor&gt; &amp;, c10::optional&lt;at::Tensor&gt; &amp;, ) +  ( in /opt/conda/lib/python3/site-packages/selective_scan_cuda.cpython-x86_64-linux-gnu.so)\nframe #: &lt;unknown </code></pre>",
          "votes": null,
          "replies": [
            {
              "id": 2814647,
              "author_name": "aryansatpathy",
              "author_url": "",
              "post_date": "05/15/2024 13:20:01",
              "content": "<p>Hi, I am facing a similar issue and was wondering if you had any luck fixing it (or finding a workaround). </p>",
              "votes": null,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2711772,
      "author_name": "quan0095",
      "author_url": "",
      "post_date": "03/23/2024 04:10:56",
      "content": "<p>I will try mamba :v</p>",
      "votes": null,
      "replies": [
        {
          "id": 2712408,
          "author_name": "yyyu54",
          "author_url": "",
          "post_date": "03/23/2024 14:43:00",
          "content": "<p>Awesome, can you please share the performance when you tested it? Thanks!</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2710771": "Has anyone tried SSM architecture models like Mamba? How's the performance? I was able to train one mamba model locally with a decent CV but couldn't get it running on a Kaggle notebook yet.",
    "2711420": "I have yet to see a Kaggle competition in which Mamba beats transformer. When I do, I will start to believe in Mamba—good luck, haha. Well, as I understand it, Mamba's main selling point is fast inference, so unless inference time is a problem (in this competition, it's not), there is apparently no reason to use Mamba over pure transformer(?).",
    "2711753": "Haven't tried it yet, \nif you share what are obstacles to run on kaggle",
    "2711772": "I will try mamba :v",
    "2712406": "Yeah that's a good point! Although I think there's a potential for Mamba models considering it's still relatively new compared to the transformer models. :)",
    "2712408": "Awesome, can you please share the performance when you tested it? Thanks!",
    "2712435": "This is what I got, it seems it has to do something with the selective scan function from the mamba package\n\n```\nFile /kaggle/input/mamba-v1-2/MedMamba.py:402, in SS2D.forward_corev0(self, x)\n    399 As = -torch.exp(self.A_logs.float()).view(-1, self.d_state)  # (k * d, d_state)\n    400 dt_projs_bias = self.dt_projs_bias.float().view(-1) # (k * d)\n--> 402 out_y = self.selective_scan(\n    403     xs, dts, \n    404     As, Bs, Cs, Ds, z=None,\n    405     delta_bias=dt_projs_bias,\n    406     delta_softplus=True,\n    407     return_last_state=False,\n    408 ).view(B, K, -1, L)\n    409 assert out_y.dtype == torch.float\n    411 inv_y = torch.flip(out_y[:, 2:4], dims=[-1]).view(B, 2, -1, L)\n\nFile /opt/conda/lib/python3.10/site-packages/mamba_ssm/ops/selective_scan_interface.py:88, in selective_scan_fn(u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n     82 def selective_scan_fn(u, delta, A, B, C, D=None, z=None, delta_bias=None, delta_softplus=False,\n     83                      return_last_state=False):\n     84     \"\"\"if return_last_state is True, returns (out, last_state)\n     85     last_state has shape (batch, dim, dstate). Note that the gradient of the last state is\n     86     not considered in the backward pass.\n     87     \"\"\"\n---> 88     return SelectiveScanFn.apply(u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n\nFile /opt/conda/lib/python3.10/site-packages/torch/autograd/function.py:539, in Function.apply(cls, *args, **kwargs)\n    536 if not torch._C._are_functorch_transforms_active():\n    537     # See NOTE: [functorch vjp and autograd interaction]\n    538     args = _functorch.utils.unwrap_dead_wrappers(args)\n--> 539     return super().apply(*args, **kwargs)  # type: ignore[misc]\n    541 if cls.setup_context == _SingleLevelFunction.setup_context:\n    542     raise RuntimeError(\n    543         \"In order to use an autograd.Function with functorch transforms \"\n    544         \"(vmap, grad, jvp, jacrev, ...), it must override the setup_context \"\n    545         \"staticmethod. For more details, please see \"\n    546         \"https://pytorch.org/docs/master/notes/extending.func.html\"\n    547     )\n\nFile /opt/conda/lib/python3.10/site-packages/mamba_ssm/ops/selective_scan_interface.py:42, in SelectiveScanFn.forward(ctx, u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)\n     40     C = rearrange(C, \"b dstate l -> b 1 dstate l\")\n     41     ctx.squeeze_C = True\n---> 42 out, x, *rest = selective_scan_cuda.fwd(u, delta, A, B, C, D, z, delta_bias, delta_softplus)\n     43 ctx.delta_softplus = delta_softplus\n     44 ctx.has_z = z is not None\n\nRuntimeError: CUDA error: no kernel image is available for execution on the device\nCUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.\nFor debugging consider passing CUDA_LAUNCH_BLOCKING=1.\nCompile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.\n\nException raised from c10_cuda_check_implementation at /usr/local/src/pytorch/c10/cuda/CUDAException.cpp:44 (most recent call first):\nframe #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x6c (0x78ad0cf4151c in /opt/conda/lib/python3.10/site-packages/torch/lib/libc10.so)\nframe #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0xfa (0x78ad0cef69f0 in /opt/conda/lib/python3.10/site-packages/torch/lib/libc10.so)\nframe #2: c10::cuda::c10_cuda_check_implementation(int, char const*, char const*, int, bool) + 0x3cc (0x78ad0cfe601c in /opt/conda/lib/python3.10/site-packages/torch/lib/libc10_cuda.so)\nframe #3: selective_scan_fwd_launch<128, 16, float, float>(SSMParamsBase&, CUstream_st*)::{lambda()#1}::operator()() const::{lambda()#1}::operator()() const::{lambda()#1}::operator()() const::{lambda()#1}::operator()() const::{lambda()#1}::operator()() const + 0x20e (0x78acb3238e6e in /opt/conda/lib/python3.10/site-packages/selective_scan_cuda.cpython-310-x86_64-linux-gnu.so)\nframe #4: void selective_scan_fwd_cuda<float, float>(SSMParamsBase&, CUstream_st*) + 0x21c (0x78acb323a65c in /opt/conda/lib/python3.10/site-packages/selective_scan_cuda.cpython-310-x86_64-linux-gnu.so)\nframe #5: selective_scan_fwd(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::optional<at::Tensor> const&, c10::optional<at::Tensor> const&, c10::optional<at::Tensor> const&, bool) + 0x13b4 (0x78acb31890f4 in /opt/conda/lib/python3.10/site-packages/selective_scan_cuda.cpython-310-x86_64-linux-gnu.so)\nframe #6: <unknown function> + 0x8e574 (0x78acb319b574 in /opt/conda/lib/python3.10/site-packages/selective_scan_cuda.cpython-310-x86_64-linux-gnu.so)\nframe #7: <unknown function> + 0x8b93f (0x78acb319893f in /opt/conda/lib/python3.10/site-packages/selective_scan_cuda.cpython-310-x86_64-linux-gnu.so)\nframe #8: <unknown function> + 0x144446 (0x5a7dd967a446 in /opt/conda/bin/python)\nframe #9: _PyObject_MakeTpCall + 0x26b (0x5a7dd967397b in /opt/conda/bin/python)\nframe #10: _PyEval_EvalFrameDefault + 0x54b6 (0x5a7dd966f8c6 in /opt/conda/bin/python)\nframe #11: _PyFunction_Vectorcall + 0x6c (0x5a7dd967a8cc in /opt/conda/bin/python)\nframe #12: THPFunction_apply(_object*, _object*) + 0x1048 (0x78ad4d4050b8 in /opt/conda/lib/python3.10/site-packages/torch/lib/libtorch_python.so)\nframe #13: <unknown function> + 0x144468 (0x5a7dd967a468 in /opt/conda/bin/python)\nframe #14: PyObject_Call + 0x207 (0x5a7dd9686ee7 in /opt/conda/bin/python)\nframe #15: _PyEval_EvalFrameDefault + 0x5d5d (0x5a7dd967016d in /opt/conda/bin/python)\nframe #16: <unknown function> + 0x150402 (0x5a7dd9686402 in /opt/conda/bin/python)\nframe #17: _PyEval_EvalFrameDefault + 0x4c12 (0x5a7dd966f022 in /opt/conda/bin/python)\nframe #18: _PyFunction_Vectorcall + 0x6c (0x5a7dd967a8cc in /opt/conda/bin/python)\n```",
    "2814647": "Hi, I am facing a similar issue and was wondering if you had any luck fixing it (or finding a workaround)."
  },
  "source": "meta"
}