pymc-devs / pymc-devs/pytensor

BUG: Compiler error when calling pm.sample()

Open
#952 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs info
Dominant language
Python
Stars
644
Forks
208
Avg merge
2d 14h
Merged PRs (30d)
16

Description

Describe the issue:
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: Cast{float64}(0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?85d2c47e-6f93-45c4-9cd4-51f3559d78d2) or open in a [text editor](command:workbench.action.openLargeOutput?85d2c47e-6f93-45c4-9cd4-51f3559d78d2). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_m54fx0m6](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_m54fx0m6)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: DropDims{axis=0}([2])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?a9c4bc36-001c-4233-b3c0-ec8a40f583fe) or open in a [text editor](command:workbench.action.openLargeOutput?a9c4bc36-001c-4233-b3c0-ec8a40f583fe). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_9_cnifx5](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_9_cnifx5)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: Cast{float32}(1)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?bda15d87-5c57-40ae-abfb-3c68accfbb80) or open in a [text editor](command:workbench.action.openLargeOutput?bda15d87-5c57-40ae-abfb-3c68accfbb80). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_hq9mi7__](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_hq9mi7__)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: Cast{float64}(0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?fc256f94-8376-4e96-8523-c15e500f10c1) or open in a [text editor](command:workbench.action.openLargeOutput?fc256f94-8376-4e96-8523-c15e500f10c1). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_jy0cd6x7](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_jy0cd6x7)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: DropDims{axis=0}([2])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?18155b83-1180-48f3-b549-4782f452a695) or open in a [text editor](command:workbench.action.openLargeOutput?18155b83-1180-48f3-b549-4782f452a695). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_pmkk0bbv](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_pmkk0bbv)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: Cast{float64}(1)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?dbb04a6e-9d4f-421b-9a94-f07200c0489d) or open in a [text editor](command:workbench.action.openLargeOutput?dbb04a6e-9d4f-421b-9a94-f07200c0489d). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_w5w60_ob](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_w5w60_ob)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: Cast{float64}(0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?80daa58b-8668-4001-a220-d5c7b17d4915) or open in a [text editor](command:workbench.action.openLargeOutput?80daa58b-8668-4001-a220-d5c7b17d4915). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_v51bqnq5](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_v51bqnq5)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: DropDims{axis=0}([2])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?ad644fe2-f670-4391-8cb0-7def9e4d57be) or open in a [text editor](command:workbench.action.openLargeOutput?ad644fe2-f670-4391-8cb0-7def9e4d57be). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_g9xiogsb](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_g9xiogsb)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: Cast{float64}(1)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?0af331cf-c5a3-4a57-926a-bbb617d9e0eb) or open in a [text editor](command:workbench.action.openLargeOutput?0af331cf-c5a3-4a57-926a-bbb617d9e0eb). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_8e_z6g4h](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_8e_z6g4h)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: Cast{float64}(0)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?01f67d7c-6aa5-4339-8c9f-c641080947a2) or open in a [text editor](command:workbench.action.openLargeOutput?01f67d7c-6aa5-4339-8c9f-c641080947a2). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_t3471my9](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_t3471my9)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: DropDims{axis=0}([2])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?ff9dfcd3-96b3-4456-9447-18ce634cffba) or open in a [text editor](command:workbench.action.openLargeOutput?ff9dfcd3-96b3-4456-9447-18ce634cffba). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_cyj_s6gg](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_cyj_s6gg)
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: Cast{float64}(1)
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1919, in process_node
    replacements = node_rewriter.transform(fgraph, node)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/graph/rewriting/basic.py", line 1081, in transform
    return self.fn(fgraph, node)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/tensor/rewriting/basic.py", line 1120, in constant_folding
    thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 119, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/op.py", line 84, in make_c_thunk
    outputs = cl.make_thunk(
              ^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1190, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
                                                             ^^^^^^^^^^^^^^^^^
  File "/Users/muntazirabidi/miniforge3/envs/pymc/lib/python3.12/site-packages/pytensor/link/c/basic.py", line 1110, in __compile__
    thunk, module = self.cthunk_factory(
                    ^^^^^^^^^^^^^^^^^^^^
...
           ^~~~~~~~~~
7 errors generated.


Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?dad86ac2-950b-4067-b089-33d5f1edc59e) or open in a [text editor](command:workbench.action.openLargeOutput?dad86ac2-950b-4067-b089-33d5f1edc59e). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error__sb_w708](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error__sb_w708)

You can find the C code in this temporary file: [/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_2ntheoqf](https://file+.vscode-resource.vscode-cdn.net/var/folders/fc/xqlqp1_91msbj5k907rjvrm80000gn/T/pytensor_compilation_error_2ntheoqf)
Reproduceable code example:
just calling pymc.sample() on a simple model
Error message:

No response

PyMC version information:

pymc 5.12.1

Context for the issue:

No response

Contributor guide

Open the contributing guide

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.

Research direction

Start by reproducing the pm.sample() call and inspect the full compiler output and temporary C file referenced in the report. Trace the failure through pytensor/graph/rewriting/basic.py and pytensor/link/c/basic.py; done means identifying the compiler failure, applying a fix, and adding a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.