File tree Expand file tree Collapse file tree 10 files changed +53
-17
lines changed
Expand file tree Collapse file tree 10 files changed +53
-17
lines changed Original file line number Diff line number Diff line change 5151 run : |
5252 set -ex
5353 source /usr/local/Ascend/ascend-toolkit/set_env.sh
54+ source /usr/local/Ascend/nnal/atb/set_env.sh
5455 cd ${{ env.CI_PATH }}
5556 pip uninstall -y dlinfer-ascend
5657 pip install -r requirements/ascend/full.txt
Original file line number Diff line number Diff line change @@ -25,8 +25,4 @@ elseif(NOT DEVICE IN_LIST SUPPORTED_DEVICE)
2525endif ()
2626
2727add_subdirectory (dlinfer/vendor/${DEVICE} )
28-
29- if ("$ENV{DICP} " STREQUAL "true" )
30- add_subdirectory (dlinfer/graph/dicp/vendor/AtbGraph/codegen/runtime)
31- endif ()
32-
28+ add_subdirectory (dlinfer/graph/dicp/vendor)
Original file line number Diff line number Diff line change @@ -67,12 +67,14 @@ set(COMPILE_OPTIONS
6767set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2" )
6868
6969add_library (dicp_model SHARED ${SOURCES} )
70- set_target_properties (dicp_model PROPERTIES
71- OUTPUT_NAME "dicp_model"
72- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} /../
73- )
7470
7571target_compile_options (dicp_model PRIVATE ${COMPILE_OPTIONS} )
7672
7773target_link_libraries (dicp_model PRIVATE
7874 atb torch c10 torch_cpu torch_python torch_npu opapi)
75+
76+ file (RELATIVE_PATH OUTPUT_LIB_RELATIVE_PATH "${CMAKE_SOURCE_DIR} " "${CMAKE_CURRENT_SOURCE_DIR} /../" )
77+ install (
78+ TARGETS dicp_model
79+ DESTINATION ${OUTPUT_LIB_RELATIVE_PATH}
80+ )
Original file line number Diff line number Diff line change 1+ if (DEVICE STREQUAL "ascend" )
2+ add_subdirectory (AtbGraph/codegen/runtime)
3+ endif ()
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ execute_process(
88)
99
1010execute_process (
11- COMMAND bash -c "pip show torch-npu | awk '/^Location:/{ORS=\"\" ; print \$ 2\" /torch_npu\" }'"
11+ COMMAND python -c "from importlib.metadata import distribution; \
12+ print(str(distribution('torch_npu').locate_file('torch_npu')), end='')"
1213 OUTPUT_VARIABLE Torch_npu_ROOT
1314)
1415
@@ -62,7 +63,8 @@ target_link_libraries(
6263 PUBLIC ${HCCL_LIBRARY}
6364)
6465
66+ file (RELATIVE_PATH OUTPUT_LIB_RELATIVE_PATH "${CMAKE_SOURCE_DIR} " "${CMAKE_CURRENT_SOURCE_DIR} " )
6567install (
6668 TARGETS ${PROJECT_NAME}
67- DESTINATION ./dlinfer/vendor/ascend
69+ DESTINATION ${OUTPUT_LIB_RELATIVE_PATH}
6870)
Original file line number Diff line number Diff line change 22requires = [
33 " pyyaml" ,
44 " scikit-build" ,
5+ " setuptools==69.5.1" ,
56]
67build-backend = " setuptools.build_meta"
Original file line number Diff line number Diff line change 1- torch==2.1.0
2- torchvision==0.16.0
3- torch-npu==2.1.0.post6
1+ torch==2.3.1
2+ torchvision==0.18.1
3+ torch-npu==2.3.1
44numpy<2.0.0
55pyyaml
Original file line number Diff line number Diff line change 33
44REPO_ROOT=$( cd $( dirname $( dirname $0 ) ) ; pwd)
55pip install -U build
6- rm -rf ${REPO_ROOT} /_skbuild ${REPO_ROOT} /dlinfer.egg*
6+ rm -rf ${REPO_ROOT} /_skbuild ${REPO_ROOT} /dlinfer* .egg*
77export DEVICE=${DEVICE:- ascend}
88python -m build \
99 -C=" --build-option=--plat-name" \
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -e
3+
4+ eval " $( conda shell.bash hook) "
5+
6+ REPO_ROOT=$( cd $( dirname $( dirname $0 ) ) ; pwd)
7+ cd ${REPO_ROOT}
8+
9+ # PY_VERSION_LIST=("3.8" "3.9" "3.10")
10+ PY_VERSION_LIST=(" 3.10" )
11+ for PY_VERSION in ${PY_VERSION_LIST[@]} ; do
12+ echo start building wheels for python${PY_VERSION}
13+ PY_VERSION_NAME=${PY_VERSION/ ./ }
14+ ENV_NAME=dlinfer_build_py${PY_VERSION_NAME}
15+ conda env remove -n ${ENV_NAME} -y
16+ conda create -n ${ENV_NAME} python=${PY_VERSION} -y
17+ conda activate ${ENV_NAME}
18+ pip install -U build
19+ bash ${REPO_ROOT} /scripts/build_wheel.sh
20+ conda deactivate
21+ conda env remove -n ${ENV_NAME} -y
22+ echo end building wheels for python${PY_VERSION}
23+ done
Original file line number Diff line number Diff line change 55from skbuild import setup
66
77
8- VERSION = "0.1.0post1 "
8+ VERSION = "0.1.1 "
99
1010vendor_dispatch_key_map = {
1111 "ascend" : "PrivateUse1" ,
@@ -71,6 +71,14 @@ def get_requirements(file_name):
7171 return requirements
7272
7373
74+ def get_vendor_excludes ():
75+ device = get_device ()
76+ exclude_vendors = [
77+ name for name in vendor_dispatch_key_map .keys () if name != device
78+ ]
79+ return [f"dlinfer.vendor.{ name } " for name in exclude_vendors ]
80+
81+
7482def get_entry_points ():
7583 device = get_device ()
7684 if device == "ascend" :
@@ -91,7 +99,7 @@ def main():
9199 long_description = get_readme (),
92100 long_description_content_type = "text/markdown" ,
93101 url = "https://github.com/DeepLink-org/dlinfer" ,
94- packages = find_packages (),
102+ packages = find_packages (exclude = get_vendor_excludes () ),
95103 package_data = get_package_data (),
96104 exclude_package_data = {"" : ["tests/*" ]},
97105 cmake_args = get_cmake_args (),
You can’t perform that action at this time.
0 commit comments