Exception: ('Compilation failed (return status=1) · Issue #5107 · pymc-devs/pymc (original) (raw)

I just installed pymc3, following latest instructions from here, using coda and pip. Installation proceeded with no issues, but when I try to create a model I first get this warning:


with pm.Model() as model:
    alpha = 1.0/count_data.mean()  # Recall count_data is the
                                   # variable that holds our txt counts
    lambda_1 = pm.Exponential("lambda_1", alpha)
    lambda_2 = pm.Exponential("lambda_2", alpha)
    
    tau = pm.DiscreteUniform("tau", lower=0, upper=n_count_data - 1)

WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

Then when I try to run the model I get this exception. It looks like Theano is not compiling correctly. I looked online and tried a bunch of things but I keep getting this error.

with model:
    idx = np.arange(n_count_data) # Index
    lambda_ = pm.math.switch(tau > idx, lambda_1, lambda_2)

You can find the C code in this temporary file: C:\Users\kuvychko\AppData\Local\Temp\theano_compilation_error_49a3or71
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_19904/1411181576.py in <module>
      1 with model:
      2     idx = np.arange(n_count_data) # Index
----> 3     lambda_ = pm.math.switch(tau > idx, lambda_1, lambda_2)

~\Anaconda3\envs\pymc3\lib\site-packages\theano\tensor\var.py in __gt__(self, other)
     39 
     40     def __gt__(self, other):
---> 41         rval = theano.tensor.basic.gt(self, other)
     42         rval._is_nonzero = False
     43         return rval

~\Anaconda3\envs\pymc3\lib\site-packages\theano\graph\op.py in __call__(self, *inputs, **kwargs)
    251 
    252         if config.compute_test_value != "off":
--> 253             compute_test_value(node)
    254 
    255         if self.default_output is not None:

~\Anaconda3\envs\pymc3\lib\site-packages\theano\graph\op.py in compute_test_value(node)
    124 
    125     # Create a thunk that performs the computation
--> 126     thunk = node.op.make_thunk(node, storage_map, compute_map, no_recycling=[])
    127     thunk.inputs = [storage_map[v] for v in node.inputs]
    128     thunk.outputs = [storage_map[v] for v in node.outputs]

~\Anaconda3\envs\pymc3\lib\site-packages\theano\graph\op.py in make_thunk(self, node, storage_map, compute_map, no_recycling, impl)
    632             )
    633             try:
--> 634                 return self.make_c_thunk(node, storage_map, compute_map, no_recycling)
    635             except (NotImplementedError, MethodNotDefined):
    636                 # We requested the c code, so don't catch the error.

~\Anaconda3\envs\pymc3\lib\site-packages\theano\graph\op.py in make_c_thunk(self, node, storage_map, compute_map, no_recycling)
    598                 print(f"Disabling C co
[theano_compilation_error_49a3or71.txt](https://github.com/pymc-devs/pymc/files/7431095/theano_compilation_error_49a3or71.txt)
de for {self} due to unsupported float16")
    599                 raise NotImplementedError("float16")
--> 600         outputs = cl.make_thunk(
    601             input_storage=node_input_storage, output_storage=node_output_storage
    602         )

~\Anaconda3\envs\pymc3\lib\site-packages\theano\link\c\basic.py in make_thunk(self, input_storage, output_storage, storage_map)
   1201         """
   1202         init_tasks, tasks = self.get_init_tasks()
-> 1203         cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
   1204             input_storage, output_storage, storage_map
   1205         )

~\Anaconda3\envs\pymc3\lib\site-packages\theano\link\c\basic.py in __compile__(self, input_storage, output_storage, storage_map)
   1136         input_storage = tuple(input_storage)
   1137         output_storage = tuple(output_storage)
-> 1138         thunk, module = self.cthunk_factory(
   1139             error_storage,
   1140             input_storage,

~\Anaconda3\envs\pymc3\lib\site-packages\theano\link\c\basic.py in cthunk_factory(self, error_storage, in_storage, out_storage, storage_map)
   1632             for node in self.node_order:
   1633                 node.op.prepare_node(node, storage_map, None, "c")
-> 1634             module = get_module_cache().module_from_key(key=key, lnk=self)
   1635 
   1636         vars = self.inputs + self.outputs + self.orphans

~\Anaconda3\envs\pymc3\lib\site-packages\theano\link\c\cmodule.py in module_from_key(self, key, lnk)
   1189             try:
   1190                 location = dlimport_workdir(self.dirname)
-> 1191                 module = lnk.compile_cmodule(location)
   1192                 name = module.__file__
   1193                 assert name.startswith(location)

~\Anaconda3\envs\pymc3\lib\site-packages\theano\link\c\basic.py in compile_cmodule(self, location)
   1541             try:
   1542                 _logger.debug(f"LOCATION {location}")
-> 1543                 module = c_compiler.compile_str(
   1544                     module_name=mod.code_hash,
   1545                     src_code=src_code,

~\Anaconda3\envs\pymc3\lib\site-packages\theano\link\c\cmodule.py in compile_str(module_name, src_code, location, include_dirs, lib_dirs, libs, preargs, py_module, hide_symbols)
   2544             # difficult to read.
   2545             compile_stderr = compile_stderr.replace("\n", ". ")
-> 2546             raise Exception(
   2547                 f"Compilation failed (return status={status}): {compile_stderr}"
   2548             )

Exception: ('Compilation failed (return status=1): C:\\Users\\kuvychko\\AppData\\Local\\Temp\\ccNwfwin.s: Assembler messages:\r. C:\\Users\\kuvychko\\AppData\\Local\\Temp\\ccNwfwin.s💯 Error: invalid register for .seh_savexmm\r. ', 'FunctionGraph(Elemwise{gt,no_inplace}(<TensorType(int64, (True,))>, TensorConstant{[ 0  1  2 ..71\n 72 73]}))')</summary>
===============================
Problem occurred during compilation with the command line below:
"C:\Users\kuvychko\Anaconda3\envs\pymc3\Library\mingw-w64\bin\g++.exe" -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -Wno-c++11-narrowing -march=knl -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mavx512f -mno-avx512er -mavx512cd -mno-avx512pf -mno-prefetchwt1 -mclflushopt -mxsavec -mxsaves -mavx512dq -mavx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mclwb -mno-pcommit -mno-mwaitx --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=16896 -mtune=generic -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -I"C:\Users\kuvychko\Anaconda3\envs\pymc3\lib\site-packages\numpy\core\include" -I"C:\Users\kuvychko\Anaconda3\envs\pymc3\include" -I"C:\Users\ivkuvych\Anaconda3\envs\pymc3\lib\site-packages\theano\link\c\c_code" -L"C:\Users\ivkuvych\Anaconda3\envs\pymc3\libs" -L"C:\Users\kuvychko\Anaconda3\envs\pymc3" -o "C:\Users\ivkuvych\AppData\Local\Theano\compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_85_Stepping_7_GenuineIntel-3.9.7-64\tmp2ek9r7vj\mc1f4d5aa16af0197cc70b7bc597a62d848acd658b811a4198cff42bb584d9a62.pyd" "C:\Users\kuvychko\AppData\Local\Theano\compiledir_Windows-10-10.0.19042-SP0-Intel64_Family_6_Model_85_Stepping_7_GenuineIntel-3.9.7-64\tmp2ek9r7vj\mod.cpp" -lpython39C:\Users\kuvychko\AppData\Local\Temp\ccNwfwin.s: Assembler messages:

C:\Users\kuvychko\AppData\Local\Temp\ccNwfwin.s💯 Error: invalid register for .seh_savexmm