Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
TransformerEngine
Commits
40816696
Commit
40816696
authored
Jan 05, 2026
by
wenjh
Browse files
Make hygon backend installable
Signed-off-by:
wenjh
<
wenjh@sugon.com
>
parent
73d959a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
build_tools/build_ext.py
build_tools/build_ext.py
+4
-1
setup.py
setup.py
+11
-10
No files found.
build_tools/build_ext.py
View file @
40816696
...
@@ -145,7 +145,10 @@ def get_build_ext(
...
@@ -145,7 +145,10 @@ def get_build_ext(
# For editable/inplace builds this is not a concern as
# For editable/inplace builds this is not a concern as
# the SOs will be in a local directory anyway.
# the SOs will be in a local directory anyway.
if
not
self
.
inplace
:
if
not
self
.
inplace
:
target_dir
=
install_dir
/
"transformer_engine"
/
lib_dir
if
not
bool
(
int
(
os
.
getenv
(
"NVTE_HYGON_BACKEND"
,
"0"
))):
target_dir
=
install_dir
/
"transformer_engine"
/
lib_dir
else
:
target_dir
=
install_dir
/
"transformer_engine_hygon"
/
lib_dir
target_dir
.
mkdir
(
exist_ok
=
True
,
parents
=
True
)
target_dir
.
mkdir
(
exist_ok
=
True
,
parents
=
True
)
for
ext
in
Path
(
self
.
build_lib
).
glob
(
"*.so"
):
for
ext
in
Path
(
self
.
build_lib
).
glob
(
"*.so"
):
...
...
setup.py
View file @
40816696
...
@@ -50,6 +50,17 @@ if rocm_build():
...
@@ -50,6 +50,17 @@ if rocm_build():
else
:
else
:
archs
=
cuda_archs
()
archs
=
cuda_archs
()
if
bool
(
int
(
os
.
getenv
(
"NVTE_HYGON_BACKEND"
,
"0"
))):
common_dir
=
current_file_path
/
"transformer_engine"
/
"common"
common_copy
=
current_file_path
/
"transformer_engine_hygon"
/
"common"
if
common_copy
.
exists
():
shutil
.
rmtree
(
common_copy
)
shutil
.
copytree
(
common_dir
,
common_copy
)
csrc_dir
=
current_file_path
/
"transformer_engine"
/
"pytorch"
/
"csrc"
csrc_copy
=
current_file_path
/
"transformer_engine_hygon"
/
"pytorch"
/
"csrc"
if
csrc_copy
.
exists
():
shutil
.
rmtree
(
csrc_copy
)
shutil
.
copytree
(
csrc_dir
,
csrc_copy
)
class
TimedBdist
(
bdist_wheel
):
class
TimedBdist
(
bdist_wheel
):
"""Helper class to measure build time"""
"""Helper class to measure build time"""
...
@@ -297,16 +308,6 @@ if __name__ == "__main__":
...
@@ -297,16 +308,6 @@ if __name__ == "__main__":
)
)
else
:
else
:
# Configure package of hygon backend for TransformerEngine-FL
# Configure package of hygon backend for TransformerEngine-FL
common_dir
=
current_file_path
/
"transformer_engine"
/
"common"
common_copy
=
current_file_path
/
"transformer_engine_hygon"
/
"common"
if
common_copy
.
exists
():
shutil
.
rmtree
(
common_copy
)
shutil
.
copytree
(
common_dir
,
common_copy
)
csrc_dir
=
current_file_path
/
"transformer_engine"
/
"pytorch"
/
"csrc"
csrc_copy
=
current_file_path
/
"transformer_engine_hygon"
/
"pytorch"
/
"csrc"
if
csrc_copy
.
exists
():
shutil
.
rmtree
(
csrc_copy
)
shutil
.
copytree
(
csrc_dir
,
csrc_copy
)
setuptools
.
setup
(
setuptools
.
setup
(
name
=
"transformer_engine_hygon"
,
name
=
"transformer_engine_hygon"
,
version
=
__version__
,
version
=
__version__
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment