Skip to content

[fix] fix import error cased by _load_cuda_libs when running pytest#39

Open
Darryl233 wants to merge 2 commits intoflagos-ai:mainfrom
Darryl233:main
Open

[fix] fix import error cased by _load_cuda_libs when running pytest#39
Darryl233 wants to merge 2 commits intoflagos-ai:mainfrom
Darryl233:main

Conversation

@Darryl233
Copy link
Copy Markdown
Collaborator

Description

When using pytest to test CI, the working directory is the TransformerEngine-FL project directory, and te_path points to the local source tree TransformerEngine-FL/. There are no .so files in the source tree (they are in build/ or site-packages), which causes it to return False.
Fixes # (issue)

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • Add a TE_LIB_PATH environment variable to manually override TE_PATH during pytest execution.

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 14, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Darryl233
❌ liyuzhuo


liyuzhuo seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.


te_path = Path(importlib.util.find_spec("transformer_engine").origin).parent.parent
te_path_override = os.environ.get("TE_LIB_PATH")
if te_path_override:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this PR, only the te_path in vendor/cuda was updated.
Don't the te_path entries under vendor/ for other hardware vendors (such as hygon) also need to be updated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants