"src/include/vscode:/vscode.git/clone" did not exist on "4c031df75ab3359c422e7143e8ca32fc3000ad52"
Unverified Commit 1c417ae7 authored by Paul Fultz II's avatar Paul Fultz II Committed by GitHub
Browse files

Fix issues with python 'ImportError' (#690)

* Fix issue with module wrapper

* Formatting

* Remove custom build of python 3.6

* Fix print function in tests

* Formatting

* Install onnx

* Download the models

* Add gcc 5

* Boost time limit for now

* Try to use oauth instead of app

* Disable all warnings
parent 1bfb147d
FROM ubuntu:xenial-20180417
FROM ubuntu:18.04
ARG PREFIX=/usr/local
......@@ -23,6 +23,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-
comgr \
curl \
doxygen \
g++-5 \
g++-7 \
gdb \
git \
......
......@@ -32,7 +32,7 @@ def rocmtestnode(Map conf) {
stage("checkout ${variant}") {
checkout scm
}
gitStatusWrapper(credentialsId: 'github-app-rocm-mici', gitHubContext: "Jenkins - ${variant}", account: 'ROCmSoftwarePlatform', repo: 'AMDMIGraphX') {
gitStatusWrapper(credentialsId: '7126e5fe-eb51-4576-b52b-9aaf1de8f0fd', gitHubContext: "Jenkins - ${variant}", account: 'ROCmSoftwarePlatform', repo: 'AMDMIGraphX') {
pre()
stage("image ${variant}") {
try {
......@@ -43,7 +43,7 @@ def rocmtestnode(Map conf) {
}
}
withDockerContainer(image: image, args: "--device=/dev/kfd --device=/dev/dri --group-add video --cap-add SYS_PTRACE ${docker_args}") {
timeout(time: 1, unit: 'HOURS') {
timeout(time: 2, unit: 'HOURS') {
body(cmake_build)
}
}
......
......@@ -46,13 +46,16 @@ function(py_add_module NAME)
endfunction()
set(PYTHON_SEARCH_VERSIONS 2.7 3.5 3.6 3.7 3.8 3.9)
set(PYTHON_VERSIONS)
set(_PYTHON_VERSIONS)
foreach(PYTHON_VERSION ${PYTHON_SEARCH_VERSIONS})
find_python(${PYTHON_VERSION})
if(TARGET python${PYTHON_VERSION}::headers)
message(STATUS "Python ${PYTHON_VERSION} found.")
list(APPEND PYTHON_VERSIONS ${PYTHON_VERSION})
list(APPEND _PYTHON_VERSIONS ${PYTHON_VERSION})
else()
message(STATUS "Python ${PYTHON_VERSION} not found.")
endif()
endforeach()
\ No newline at end of file
endforeach()
# Make the variable global
set(PYTHON_VERSIONS "${_PYTHON_VERSIONS}" CACHE INTERNAL "" FORCE)
pfultz2/rocm-recipes
danmar/cppcheck@ef714225bb31e9a76ac2484796763572386955ae -DHAVE_RULES=1
ROCm-Developer-Tools/HIP@roc-3.0.0
python/cpython@v3.6.6 -X autotools -H sha256:92aa914572c695c0aeb01b0a214813f414da4b51a371234df514a74761f2bb36
-f requirements.txt
......@@ -48,6 +48,13 @@ RUN pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.
ADD doc/requirements.txt /doc-requirements.txt
RUN pip3 install -r /doc-requirements.txt
RUN pip3 install onnx==1.7.0 numpy==1.18.5 typing==3.7.4 pytest==6.0.1
# Download real models to run onnx unit tests
ENV ONNX_HOME=$HOME
COPY ./tools/download_models.sh /
RUN chmod +x /download_models.sh && /download_models.sh && rm /download_models.sh
# Install dependencies
ADD dev-requirements.txt /dev-requirements.txt
ADD requirements.txt /requirements.txt
......
......@@ -213,6 +213,8 @@ inline namespace MIGRAPHX_INLINE_NS {
struct module_wrap
{
migraphx::program* prog;
operator const migraphx::program&() const { return *prog; }
operator migraphx::program&() { return *prog; }
};
} // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx
......@@ -256,9 +258,12 @@ MIGRAPHX_PYBIND11_MODULE(migraphx, m)
py::class_<migraphx::target>(m, "target");
py::class_<migraphx::module>(m, "module").def("print", [](const migraphx::module& mm) {
std::cout << mm << std::endl;
});
py::class_<migraphx::module_wrap>(m, "module")
.def("print", [](const migraphx::module_wrap& mm) { std::cout << *mm.prog << std::endl; })
.def("__eq__", std::equal_to<migraphx::program>{})
.def("__ne__", std::not_equal_to<migraphx::program>{})
.def("__repr__",
[](const migraphx::module_wrap& mm) { return migraphx::to_string(*mm.prog); });
py::class_<migraphx::program>(m, "program")
.def("clone", [](migraphx::program& p) { return *(new migraphx::program(p)); })
......@@ -279,7 +284,7 @@ MIGRAPHX_PYBIND11_MODULE(migraphx, m)
.def("get_main_module",
[](migraphx::program& p) {
auto* mm = p.get_main_module();
return migraphx::module{*mm};
return migraphx::module_wrap{mm};
})
.def("run",
[](migraphx::program& p, py::dict params) {
......@@ -294,6 +299,7 @@ MIGRAPHX_PYBIND11_MODULE(migraphx, m)
return p.eval(pm);
})
.def("sort", &migraphx::program::sort)
.def("print", [](const migraphx::program& p) { std::cout << p << std::endl; })
.def("__eq__", std::equal_to<migraphx::program>{})
.def("__ne__", std::not_equal_to<migraphx::program>{})
.def("__repr__", [](const migraphx::program& p) { return migraphx::to_string(p); });
......
File mode changed from 100644 to 100755
......@@ -56,8 +56,8 @@ def test_add_scalar():
def test_module():
p = migraphx.parse_onnx("add_scalar_test.onnx")
mm = p.get_main_module()
p.print()
mm.print()
print(p)
print(mm)
test_conv_relu()
......
......@@ -2,6 +2,6 @@ cd /onnxruntime
pip3 install -r requirements.txt
# Add newer cmake to the path
export PATH="/opt/cmake/bin:$PATH"
export CXXFLAGS="-D__HIP_PLATFORM_HCC__=1"
export CXXFLAGS="-D__HIP_PLATFORM_HCC__=1 -w"
./build.sh --config Release --update --build --parallel --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) --test --use_migraphx
# pip3 install /code/onnxruntime/build/Linux/Release/dist/*.whl
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment