-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE] replace the extra DeviceMesh _flatten with mesh access
ghstack-source-id: a0689ec03803419d67a4a79ec325dfed15113cdf Pull Request resolved: #666
- Loading branch information
Showing
2 changed files
with
54 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
from typing import Optional | ||
|
||
import torch | ||
from torchtitan.logging import logger | ||
|
||
|
||
def check_if_feature_in_pytorch( | ||
feature_name: str, | ||
pull_request: str, | ||
min_nightly_version: Optional[str] = None, | ||
) -> None: | ||
if "git" in torch.__version__: # pytorch is built from source | ||
# notify users to check if the pull request is included in their pytorch | ||
logger.warning( | ||
"detected that the pytorch is built from source. Please make sure the PR " | ||
f"({pull_request_link}) is included in pytorch for correct {feature_name}." | ||
) | ||
elif min_nightly_version is not None and torch.__version__ < min_nightly_version: | ||
logger.warning( | ||
f"detected that the pytorch version {torch.__version__} is older than " | ||
f"{min_nightly_version}. Please upgrade a newer version to include the " | ||
f"change in ({pull_request_link}) for correct {feature_name}." | ||
) |