accelergy-project / timeloop-python Goto Github PK
View Code? Open in Web Editor NEWPython wrapper for the timeloop project.
License: MIT License
Python wrapper for the timeloop project.
License: MIT License
Hello, I've installed the package following the instructions, but I failed to get the correct output while testing timeloop-model.py --help
.
root@6cd30001db42:~/accelergy-timeloop-infrastructure/src/timeloop-python# timeloop-model.py --help Traceback (most recent call last): File "/root/.local/bin/timeloop-model.py", line 4, in <module> from pytimeloop import Config ImportError: cannot import name 'Config' from 'pytimeloop' (/root/.local/lib/python3.8/site-packages/pytimeloop/__init__.py)
How can I fix this problem?
I have read your paper and thought it was wonderful, but I still have a few questions. What is the operation of mapping a loop to a memory level? How to execute it? What kind of benefits can this bring?
Running test_mapper.py
results in the following error:
Mapspace split! Per-split Mapping Dimension [IndexFactorization] Size: 1 Residue: 0
['delay', 'energy']
terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 1) >= this->size() (which is 1)
Aborted (core dumped)
This is likely due to bug in DecoupledMapper
implementation.
Hi,
Thanks for the nice work.
I followed the installation instruction and installed it successfully. However, when I run it, it shows this error. Do you have any suggestions on how could I solve this?
File "Documents/my_code/public/new_timeloop_python/timeloop-python/pytimeloop/__init__.py", line 1, in <module> from bindings import * ImportError: Documents/my_code/public/new_timeloop_python/timeloop-python/bindings.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZTIN6search12HybridSearchE
I meet an error when I run pip install -e . I have followed the instructions and set the TIMELOOP_INCLUDE_PATH
and TIMELOOP_LIB_PATH variable.
/home/zhong/code/simulators/timeloop-python/include/pytimeloop/bindings/type_casters.h:44:10: error: passing ‘const problem::PerDataSpace<bool>’ as ‘this’ argument discards qualifiers [-fpermissive]
44 | list l(src.size());
The attachment is the full logs.
dump.txt
Some systems experience missing librt
dependency.
It looks like the library pthread
is missing as a dependency from the CMakeLists.txt files. The module does not install unless it is added.
Without it, I see the error:
/home/utils/binutils-2.37/bin/ld: CMakeFiles/pytimeloop_cpptest.dir/test-main.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/home/utils/binutils-2.37/bin/ld: /lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gmake[2]: *** [cpp_tests/pytimeloop_cpptest] Error 1
gmake[1]: *** [cpp_tests/CMakeFiles/pytimeloop_cpptest.dir/all] Error 2
gmake: *** [all] Error 2
I followed the installation instructions mentioned in the READ ME. However, I get this error:
ImportError: cannot import name 'native_invoke_accelergy' from 'bindings'
my python version is 3.10
I appreciate your help.
I followed the timeloop tutorial to install it, and then followed the timeloop-python Installing, but pip3 install -e. The following error message is returned.
(base) root@2b5da774569c:/home/workspace/gamma/accelergy-timeloop-infrastructure/src/timeloop-python# pip3 install .
Processing /home/workspace/gamma/accelergy-timeloop-infrastructure/src/timeloop-python
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: pyyaml in /root/miniforge-pypy3/lib/python3.9/site-packages (from pytimeloop==0.0.1) (6.0.1)
Building wheels for collected packages: pytimeloop
Building wheel for pytimeloop (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pytimeloop (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [150 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-pypy39
creating build/lib.linux-x86_64-pypy39/pytimeloop
copying pytimeloop/__init__.py -> build/lib.linux-x86_64-pypy39/pytimeloop
copying pytimeloop/accelergy_interface.py -> build/lib.linux-x86_64-pypy39/pytimeloop
copying pytimeloop/config.py -> build/lib.linux-x86_64-pypy39/pytimeloop
copying pytimeloop/engine.py -> build/lib.linux-x86_64-pypy39/pytimeloop
copying pytimeloop/mapper.py -> build/lib.linux-x86_64-pypy39/pytimeloop
copying pytimeloop/mapping.py -> build/lib.linux-x86_64-pypy39/pytimeloop
copying pytimeloop/mapspace.py -> build/lib.linux-x86_64-pypy39/pytimeloop
copying pytimeloop/model.py -> build/lib.linux-x86_64-pypy39/pytimeloop
copying pytimeloop/problem.py -> build/lib.linux-x86_64-pypy39/pytimeloop
copying pytimeloop/search.py -> build/lib.linux-x86_64-pypy39/pytimeloop
creating build/lib.linux-x86_64-pypy39/tests
copying tests/__init__.py -> build/lib.linux-x86_64-pypy39/tests
copying tests/test_accelerator.py -> build/lib.linux-x86_64-pypy39/tests
copying tests/test_buffer.py -> build/lib.linux-x86_64-pypy39/tests
copying tests/test_config.py -> build/lib.linux-x86_64-pypy39/tests
copying tests/test_mapper.py -> build/lib.linux-x86_64-pypy39/tests
copying tests/test_model.py -> build/lib.linux-x86_64-pypy39/tests
copying tests/test_topology.py -> build/lib.linux-x86_64-pypy39/tests
copying tests/util.py -> build/lib.linux-x86_64-pypy39/tests
creating build/lib.linux-x86_64-pypy39/pytimeloop/app
copying pytimeloop/app/__init__.py -> build/lib.linux-x86_64-pypy39/pytimeloop/app
copying pytimeloop/app/call_utils.py -> build/lib.linux-x86_64-pypy39/pytimeloop/app
copying pytimeloop/app/mapper.py -> build/lib.linux-x86_64-pypy39/pytimeloop/app
copying pytimeloop/app/model.py -> build/lib.linux-x86_64-pypy39/pytimeloop/app
creating build/lib.linux-x86_64-pypy39/tests/demo
copying tests/demo/__init__.py -> build/lib.linux-x86_64-pypy39/tests/demo
copying tests/demo/demo.py -> build/lib.linux-x86_64-pypy39/tests/demo
running build_ext
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using timeloop includes from: /home/workspace/gamma/accelergy-timeloop-infrastructure/src/timeloop/include
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- pybind11 v2.13.0 dev1
-- Found PythonInterp: /root/miniforge-pypy3/bin/python3.9 (found suitable version "3.9.18", minimum required is "3.6")
-- Found PythonLibs: python3.9
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Configuring done (0.9s)
-- Generating done (0.0s)
-- Build files have been written to: /home/workspace/gamma/accelergy-timeloop-infrastructure/src/timeloop-python/build/temp.linux-x86_64-pypy39
[ 3%] Building CXX object CMakeFiles/define_gterminate.dir/bindings/gterminate.cpp.o
[ 7%] Linking CXX static library libdefine_gterminate.a
[ 7%] Built target define_gterminate
[ 10%] Building CXX object CMakeFiles/pytimeloop.dir/src/mapper/coupled-mapper.cpp.o
[ 14%] Building CXX object CMakeFiles/pytimeloop.dir/src/mapspace/status.cpp.o
[ 17%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/accelerator.cpp.o
[ 21%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/bounded-queue-accelerator-pool.cpp.o
[ 25%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/unbounded-queue-accelerator-pool.cpp.o
[ 28%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/util.cpp.o
[ 32%] Linking CXX shared library /home/workspace/gamma/accelergy-timeloop-infrastructure/src/timeloop-python/build/lib.linux-x86_64-pypy39/libpytimeloop.so
lto-wrapper: warning: using serial compilation of 39 LTRANS jobs
../../../timeloop/src/loop-analysis/mapping-to-isl/mapping-to-isl.cpp: In function 'LogicalBufSkewsFromMapping':
../../../timeloop/src/loop-analysis/mapping-to-isl/mapping-to-isl.cpp:284:34: warning: 'MEM[(const int &)&last_y_idx_opt]' may be used uninitialized in this function [-Wmaybe-uninitialized]
284 | for (int i = last_y_idx; i < loop_idx; ++i)
| ^
../../../timeloop/src/loop-analysis/mapping-to-isl/mapping-to-isl.cpp:174:22: note: 'MEM[(const int &)&last_y_idx_opt]' was declared here
174 | std::optional<int> last_y_idx_opt = std::nullopt;
| ^
../../../timeloop/src/loop-analysis/mapping-to-isl/mapping-to-isl.cpp:246:7: warning: 'MEM[(const int &)&last_x_idx_opt]' may be used uninitialized in this function [-Wmaybe-uninitialized]
246 | for (auto i = last_x_idx; i < loop_idx; ++i)
| ^
../../../timeloop/src/loop-analysis/mapping-to-isl/mapping-to-isl.cpp:173:22: note: 'MEM[(const int &)&last_x_idx_opt]' was declared here
173 | std::optional<int> last_x_idx_opt = std::nullopt;
| ^
/usr/bin/ld: /tmp/cchzahKo.ltrans30.ltrans.o: relocation R_X86_64_TPOFF32 against symbol `gCtx' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/pytimeloop.dir/build.make:179: /home/workspace/gamma/accelergy-timeloop-infrastructure/src/timeloop-python/build/lib.linux-x86_64-pypy39/libpytimeloop.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:130: CMakeFiles/pytimeloop.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
Traceback (most recent call last):
File "/root/miniforge-pypy3/lib/pypy3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/root/miniforge-pypy3/lib/pypy3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/root/miniforge-pypy3/lib/pypy3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/build_meta.py", line 410, in build_wheel
return self._build_with_temp_dir(
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/build_meta.py", line 395, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 97, in <module>
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/__init__.py", line 104, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/core.py", line 184, in setup
return run_commands(dist)
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/dist.py", line 967, in run_command
super().run_command(command)
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/wheel/bdist_wheel.py", line 368, in run
self.run_command("build")
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/dist.py", line 967, in run_command
super().run_command(command)
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
self.run_command(cmd_name)
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/dist.py", line 967, in run_command
super().run_command(command)
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/command/build_ext.py", line 91, in run
_build_ext.run(self)
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
self.build_extensions()
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 479, in build_extensions
self._build_extensions_serial()
File "/tmp/pip-build-env-8c1iw72k/overlay/lib/pypy3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 505, in _build_extensions_serial
self.build_extension(ext)
File "<string>", line 91, in build_extension
File "/root/miniforge-pypy3/lib/pypy3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 2.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pytimeloop
Failed to build pytimeloop
ERROR: Could not build wheels for pytimeloop, which is required to install pyproject.toml-based projects
Thank you for your assistance!
I'm trying to pip3 install timeloop-python and I get this error:
CMake Error at CMakeLists.txt:55 (add_subdirectory):
The source directory
<$MYPATH>/timeloop-python/lib/pybind11
does not contain a CMakeLists.txt file.
PyTimeloop seems to not like certain instances of Timeloop compilation. It may be a factor if the static compiler is used, but it seems to be correlated more strongly with using a higher number of cores in the original Timeloop make. Suspect it's either a parallelism issue, or, more likely, a RAM issue as make occasionally will fault with a RAM allocation issue with high core counts compiling timeloop (i.e., suspect it's a silent RAM fault that gets buried in logs by a thread).
Will investigate and include reproducibility steps when time allows.
I'm trying to install the pytimeloop module. I installed the timeloop and set the TIMELOOP_INCLUDE_PATH and TIMELOOP_LIB_PATH but when I'm running the "pip3 install -e ." it will give me the following error:
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... done
Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: pyyaml in /home/kiarash/miniconda3/envs/cobra/lib/python3.8/site-packages (from
pytimeloop==0.0.1) (6.0)
Building wheels for collected packages: pytimeloop
Building editable for pytimeloop (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building editable for pytimeloop (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [140 lines of output]
running editable_wheel
creating /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info
writing /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/dependency_links.txt
writing requirements to /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/requires.txt
writing top-level names to /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/top_level.txt
writing manifest file '/tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/SOURCES.txt'
reading manifest file '/tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file '/tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/SOURCES.txt'
creating '/tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop-0.0.1.dist-info'
adding license file "LICENSE" (matched pattern "LICEN[CS]E*")
creating /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop-0.0.1.dist-info/WHEEL
running build_py
running build_ext
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using timeloop includes from: /home/kiarash/cobra/timeloop/include
-- pybind11 v2.8.0 dev2
CMake Warning (dev) at /tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/cmake/data/share/cmake-3.24/Modules/CMakeDependentOption.cmake:89 (message):
Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
Syntax. Run "cmake --help-policy CMP0127" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
lib/pybind11/CMakeLists.txt:101 (cmake_dependent_option)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found PythonInterp: /home/kiarash/miniconda3/envs/cobra/bin/python (found version "3.8.13")
-- Found PythonLibs: /home/kiarash/miniconda3/envs/cobra/lib/libpython3.8.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/tmp0uk855y2.build-temp
[ 4%] Building CXX object CMakeFiles/define_gterminate.dir/bindings/gterminate.cpp.o
[ 9%] Linking CXX shared library /tmp/tmprxx_j31b.build-lib/libdefine_gterminate.so
[ 9%] Built target define_gterminate
[ 14%] Building CXX object CMakeFiles/pytimeloop.dir/src/mapper/coupled-mapper.cpp.o
[ 19%] Building CXX object CMakeFiles/pytimeloop.dir/src/mapspace/status.cpp.o
[ 23%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/accelerator.cpp.o
[ 28%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/bounded-queue-accelerator-pool.cpp.o
[ 33%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/unbounded-queue-accelerator-pool.cpp.o
[ 38%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/util.cpp.o
[ 42%] Linking CXX shared library /tmp/tmprxx_j31b.build-lib/libpytimeloop.so
[ 42%] Built target pytimeloop
[ 47%] Building CXX object CMakeFiles/bindings.dir/bindings/accelergy_interface.cpp.o
[ 52%] Building CXX object CMakeFiles/bindings.dir/bindings/bindings.cpp.o
[ 57%] Building CXX object CMakeFiles/bindings.dir/bindings/config.cpp.o
[ 61%] Building CXX object CMakeFiles/bindings.dir/bindings/mapper.cpp.o
[ 66%] Building CXX object CMakeFiles/bindings.dir/bindings/mapping.cpp.o
/home/kiarash/cobra/timeloop-python/bindings/mapping.cpp: In function ‘void pytimeloop::mapping_bindings::BindMappingClasses(pybind11::module&)’:
/home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:24: warning: converting to ‘pybind11::arg’ from initializer list would use explicit constructor ‘constexpr pybind11::arg::arg(const char*)’
py::arg() = {}, py::arg() = {}, py::arg() = {},
^
/home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:24: note: in C++11 and above a default constructor can be explicit
/home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:40: warning: converting to ‘pybind11::arg’ from initializer list would use explicit constructor ‘constexpr pybind11::arg::arg(const char*)’
py::arg() = {}, py::arg() = {}, py::arg() = {},
^
/home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:40: note: in C++11 and above a default constructor can be explicit
/home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:56: warning: converting to ‘pybind11::arg’ from initializer list would use explicit constructor ‘constexpr pybind11::arg::arg(const char*)’
py::arg() = {}, py::arg() = {}, py::arg() = {},
^
/home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:56: note: in C++11 and above a default constructor can be explicit
[ 71%] Building CXX object CMakeFiles/bindings.dir/bindings/mapspace.cpp.o
[ 76%] Building CXX object CMakeFiles/bindings.dir/bindings/model.cpp.o
[ 80%] Building CXX object CMakeFiles/bindings.dir/bindings/problem.cpp.o
[ 85%] Building CXX object CMakeFiles/bindings.dir/bindings/search.cpp.o
[ 90%] Linking CXX shared module /tmp/tmprxx_j31b.build-lib/bindings.cpython-38-x86_64-linux-gnu.so
[ 90%] Built target bindings
[ 95%] Building CXX object cpp_tests/CMakeFiles/pytimeloop_cpptest.dir/test-main.cpp.o
In file included from /home/kiarash/cobra/timeloop-python/cpp_tests/test-main.cpp:10:
/home/kiarash/cobra/timeloop-python/cpp_tests/test-worker-pool.h: In member function ‘void WorkerPool<Worker>::worker_loop(Worker&&) [with Worker = AddOneWorker]’:
/home/kiarash/cobra/timeloop-python/cpp_tests/test-worker-pool.h:13:49: warning: ‘*((void*)& task +8)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Result operator()(Task& task) { return task + 1; }
^
In file included from /home/kiarash/cobra/timeloop-python/include/pytimeloop/mapper/coupled-mapper.h:13,
from /home/kiarash/cobra/timeloop-python/cpp_tests/test-mapper.h:10,
from /home/kiarash/cobra/timeloop-python/cpp_tests/test-main.cpp:9:
/home/kiarash/cobra/timeloop-python/include/pytimeloop/utils/worker-pool.h:75:20: note: ‘*((void*)& task +8)’ was declared here
WithId<Task> task;
^~~~
/home/kiarash/cobra/timeloop-python/include/pytimeloop/utils/worker-pool.h:75:20: warning: ‘task.WithId<int>::id’ may be used uninitialized in this function [-Wmaybe-uninitialized]
[100%] Linking CXX executable pytimeloop_cpptest
/usr/bin/ld: CMakeFiles/pytimeloop_cpptest.dir/test-main.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
cpp_tests/CMakeFiles/pytimeloop_cpptest.dir/build.make:99: recipe for target 'cpp_tests/pytimeloop_cpptest' failed
make[2]: *** [cpp_tests/pytimeloop_cpptest] Error 1
CMakeFiles/Makefile2:201: recipe for target 'cpp_tests/CMakeFiles/pytimeloop_cpptest.dir/all' failed
make[1]: *** [cpp_tests/CMakeFiles/pytimeloop_cpptest.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
Traceback (most recent call last):
File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/editable_wheel.py", line 140, in run
self._create_wheel_file(bdist_wheel)
File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/editable_wheel.py", line 330, in _create_wheel_file
files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/editable_wheel.py", line 261, in _run_build_commands
self._run_build_subcommands()
File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/editable_wheel.py", line 288, in _run_build_subcommands
self.run_command(name)
File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
self.build_extensions()
File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 466, in build_extensions
self._build_extensions_serial()
File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 492, in _build_extensions_serial
self.build_extension(ext)
File "<string>", line 91, in build_extension
File "/home/kiarash/miniconda3/envs/cobra/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 2.
error: Support for editable installs via PEP 660 was recently introduced
in `setuptools`. If you are seeing this error, please report to:
https://github.com/pypa/setuptools/issues
Meanwhile you can try the legacy behavior by setting an
environment variable and trying to install again:
SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building editable for pytimeloop
Failed to build pytimeloop
ERROR: Could not build wheels for pytimeloop, which is required to install pyproject.toml-based projects
I'm seeing the following build error when invoking pip3 install -e .
:
[ 78%] Building CXX object CMakeFiles/bindings.dir/bindings/mapping.cpp.o
.../timeloop-python/bindings/mapping.cpp:52:21: error: no viable overloaded '='
py::arg() = {}, py::arg() = {}, py::arg() = {},
~~~~~~~~~ ^ ~~
.../timeloop-python/lib/pybind11/include/pybind11/cast.h:1127:12: note: candidate template ignored: couldn't infer template argument 'T'
arg_v arg::operator=(T &&value) const {
^
.../timeloop-python/lib/pybind11/include/pybind11/cast.h:1051:8: note: candidate function (the implicit copy assignment operator) not viable: cannot convert initializer list argument to 'const pybind11::arg'
struct arg {
^
.../timeloop-python/lib/pybind11/include/pybind11/cast.h:1051:8: note: candidate function (the implicit move assignment operator) not viable: cannot convert initializer list argument to 'pybind11::arg'
Ninja error reported by @suyashbakshi in Timeloop issue NVlabs/timeloop#130.
Original comment: NVlabs/timeloop#130 (comment)
Hello,
I'm using timeloop-python bindings from a python project that involves using TensorFlow.
However, importing tensorflow while using timeloop-python bindings results in a seg fault. It appears that there is a conflict when using timeloop-python bindings in a program that also uses tensorflow/keras. My guess is that this is due to tensorflow and timeloop-python packages both having submodules named "Model". The issue can be reproduced by simply importing tensorflow into the "examples/model.py" example.
I understand this is a non-trivial issue, and probably does not concern with normal usage of this package. But I would appreciate any suggestions to solve this problem.
Otherwise, a possible solution that I could think was first to write mappings into a yaml file, and then using "os.system()" call to invoke an example script similar to "examples/model.py" that would read the yaml and evaluate the mapping. But obviously, this defeats the whole purpose of having these python bindings.
I'd appreciate any help.
Thank you
Issue is caused by binding methods and classes to submodules:
timeloop-python/bindings/bindings.cpp
Line 22 in e5ddaa1
However, the imports in PyTimeloop are not updated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.