Skip to content

Commit

Permalink
Add library path to the subprocess executable
Browse files Browse the repository at this point in the history
Summary: fbcode will add customized library path to the system executable and we need to handle that in our runner too.

Reviewed By: adamomainz

Differential Revision: D67545174

fbshipit-source-id: dc2adf735b0b6c28e01d092afc17d624211bd762
  • Loading branch information
xuzhao9 authored and facebook-github-bot committed Dec 21, 2024
1 parent 5cc3976 commit 3a5dccb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tritonbench/components/workers/subprocess_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ def __init__(
worker_env["PYTHONPATH"] = f'{worker_env["PYTHONPATH"]}:{parent_sys_path}'
else:
worker_env["PYTHONPATH"] = parent_sys_path
# setup additional library path for fbcode
if "#platform-runtime" in sys.executable:
old_library_path = os.environ.get("LD_LIBRARY_PATH", "")
lib_dir = os.path.join(
os.path.dirname(os.path.dirname(sys.executable)), "lib"
)
if os.path.exists(lib_dir):
worker_env["LD_LIBRARY_PATH"] = (
f"{lib_dir}:{old_library_path}" if old_library_path else lib_dir
)

self._proc = subprocess.Popen(
args=self.args,
stdin=subprocess.PIPE,
Expand Down

0 comments on commit 3a5dccb

Please sign in to comment.