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
08be824c
Commit
08be824c
authored
Jan 07, 2026
by
wenjh
Browse files
Rename package for tefl
Signed-off-by:
wenjh
<
wenjh@sugon.com
>
parent
bdf3d931
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
build_tools/build_ext.py
build_tools/build_ext.py
+1
-1
build_tools/pytorch.py
build_tools/pytorch.py
+1
-1
setup.py
setup.py
+10
-10
transformer_engine_hygon/__init__.py
transformer_engine_hygon/__init__.py
+0
-0
No files found.
build_tools/build_ext.py
View file @
08be824c
...
@@ -148,7 +148,7 @@ def get_build_ext(
...
@@ -148,7 +148,7 @@ def get_build_ext(
if
not
bool
(
int
(
os
.
getenv
(
"TEFL_HYGON_BACKEND"
,
"0"
))):
if
not
bool
(
int
(
os
.
getenv
(
"TEFL_HYGON_BACKEND"
,
"0"
))):
target_dir
=
install_dir
/
"transformer_engine"
/
lib_dir
target_dir
=
install_dir
/
"transformer_engine"
/
lib_dir
else
:
else
:
target_dir
=
install_dir
/
"transformer_engine_
fl_
hygon"
/
lib_dir
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"
):
...
...
build_tools/pytorch.py
View file @
08be824c
...
@@ -155,7 +155,7 @@ def setup_pytorch_extension(
...
@@ -155,7 +155,7 @@ def setup_pytorch_extension(
if
rocm_build
():
if
rocm_build
():
return
CUDAExtension
(
return
CUDAExtension
(
name
=
"transformer_engine_torch"
if
not
bool
(
int
(
os
.
getenv
(
"TEFL_HYGON_BACKEND"
,
"0"
)))
else
"transformer_engine_
fl_
torch_hygon"
,
name
=
"transformer_engine_torch"
if
not
bool
(
int
(
os
.
getenv
(
"TEFL_HYGON_BACKEND"
,
"0"
)))
else
"transformer_engine_torch_hygon"
,
sources
=
[
str
(
src
)
for
src
in
sources
],
sources
=
[
str
(
src
)
for
src
in
sources
],
include_dirs
=
[
str
(
inc
)
for
inc
in
include_dirs
],
include_dirs
=
[
str
(
inc
)
for
inc
in
include_dirs
],
extra_compile_args
=
{
extra_compile_args
=
{
...
...
setup.py
View file @
08be824c
...
@@ -52,12 +52,12 @@ else:
...
@@ -52,12 +52,12 @@ else:
if
bool
(
int
(
os
.
getenv
(
"TEFL_HYGON_BACKEND"
,
"0"
))):
if
bool
(
int
(
os
.
getenv
(
"TEFL_HYGON_BACKEND"
,
"0"
))):
common_dir
=
current_file_path
/
"transformer_engine"
/
"common"
common_dir
=
current_file_path
/
"transformer_engine"
/
"common"
common_copy
=
current_file_path
/
"transformer_engine_
fl_
hygon"
/
"common"
common_copy
=
current_file_path
/
"transformer_engine_hygon"
/
"common"
if
common_copy
.
exists
():
if
common_copy
.
exists
():
shutil
.
rmtree
(
common_copy
)
shutil
.
rmtree
(
common_copy
)
shutil
.
copytree
(
common_dir
,
common_copy
)
shutil
.
copytree
(
common_dir
,
common_copy
)
csrc_dir
=
current_file_path
/
"transformer_engine"
/
"pytorch"
/
"csrc"
csrc_dir
=
current_file_path
/
"transformer_engine"
/
"pytorch"
/
"csrc"
csrc_copy
=
current_file_path
/
"transformer_engine_
fl_
hygon"
/
"pytorch"
/
"csrc"
csrc_copy
=
current_file_path
/
"transformer_engine_hygon"
/
"pytorch"
/
"csrc"
if
csrc_copy
.
exists
():
if
csrc_copy
.
exists
():
shutil
.
rmtree
(
csrc_copy
)
shutil
.
rmtree
(
csrc_copy
)
shutil
.
copytree
(
csrc_dir
,
csrc_copy
)
shutil
.
copytree
(
csrc_dir
,
csrc_copy
)
...
@@ -128,9 +128,9 @@ def setup_common_extension() -> CMakeExtension:
...
@@ -128,9 +128,9 @@ def setup_common_extension() -> CMakeExtension:
if
not
bool
(
int
(
os
.
getenv
(
"TEFL_HYGON_BACKEND"
,
"0"
))):
if
not
bool
(
int
(
os
.
getenv
(
"TEFL_HYGON_BACKEND"
,
"0"
))):
cmake_path
=
root_path
/
Path
(
"transformer_engine/common"
)
cmake_path
=
root_path
/
Path
(
"transformer_engine/common"
)
else
:
else
:
cmake_path
=
root_path
/
Path
(
"transformer_engine_
fl_
hygon/common"
)
cmake_path
=
root_path
/
Path
(
"transformer_engine_hygon/common"
)
return
CMakeExtension
(
return
CMakeExtension
(
name
=
"transformer_engine"
if
not
bool
(
int
(
os
.
getenv
(
"TEFL_HYGON_BACKEND"
,
"0"
)))
else
"transformer_engine_
fl_
hygon"
,
name
=
"transformer_engine"
if
not
bool
(
int
(
os
.
getenv
(
"TEFL_HYGON_BACKEND"
,
"0"
)))
else
"transformer_engine_hygon"
,
cmake_path
=
cmake_path
,
cmake_path
=
cmake_path
,
cmake_flags
=
cmake_flags
,
cmake_flags
=
cmake_flags
,
)
)
...
@@ -265,9 +265,9 @@ if __name__ == "__main__":
...
@@ -265,9 +265,9 @@ if __name__ == "__main__":
else
:
else
:
ext_modules
.
append
(
ext_modules
.
append
(
setup_pytorch_extension
(
setup_pytorch_extension
(
"transformer_engine_
fl_
hygon/pytorch/csrc"
,
"transformer_engine_hygon/pytorch/csrc"
,
current_file_path
/
"transformer_engine_
fl_
hygon"
/
"pytorch"
/
"csrc"
,
current_file_path
/
"transformer_engine_hygon"
/
"pytorch"
/
"csrc"
,
current_file_path
/
"transformer_engine_
fl_
hygon"
,
current_file_path
/
"transformer_engine_hygon"
,
)
)
)
)
if
"jax"
in
frameworks
:
if
"jax"
in
frameworks
:
...
@@ -309,12 +309,12 @@ if __name__ == "__main__":
...
@@ -309,12 +309,12 @@ if __name__ == "__main__":
else
:
else
:
# Configure package of hygon backend for TransformerEngine-FL
# Configure package of hygon backend for TransformerEngine-FL
setuptools
.
setup
(
setuptools
.
setup
(
name
=
"transformer_engine_
fl_
hygon"
,
name
=
"transformer_engine_hygon"
,
version
=
__version__
,
version
=
__version__
,
packages
=
setuptools
.
find_packages
(
packages
=
setuptools
.
find_packages
(
include
=
[
include
=
[
"transformer_engine_
fl_
hygon"
,
"transformer_engine_hygon"
,
"transformer_engine_
fl_
hygon.*"
,
"transformer_engine_hygon.*"
,
],
],
),
),
extras_require
=
extras_require
,
extras_require
=
extras_require
,
...
...
transformer_engine_
fl_
hygon/__init__.py
→
transformer_engine_hygon/__init__.py
View file @
08be824c
File moved
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