Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass TPU_ML_PLATFORM_VERSION env to libtpu #7021

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion torch_xla/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import torch
import _XLAC
from ._internal import tpu
from .version import __version__

logging.basicConfig()
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -76,6 +77,8 @@ def _setup_default_env():

os.environ.setdefault('ALLOW_MULTIPLE_LIBTPU_LOAD', '1')
os.environ.setdefault('TPU_ML_PLATFORM', 'PyTorch/XLA')
# This is used for ML Framework Telemetry.
os.environ.setdefault('TPU_ML_PLATFORM_VERSION', __version__)

if tpu.version() == 4:
os.environ.setdefault('TPU_MEGACORE', 'megacore_dense')
Expand Down Expand Up @@ -149,7 +152,6 @@ def _setup_tpu_vm_library_path() -> bool:

import atexit
from ._patched_functions import _apply_patches
from .version import __version__

_found_libtpu = _setup_tpu_vm_library_path()

Expand Down
Loading