Skip to content

Add color font capability to console outputs - #77

Closed
lessw2020 wants to merge 0 commit into
pytorch:mainfrom
lessw2020:add-color-to-console-outputs
Closed

lessw2020 wants to merge 0 commit into
pytorch:mainfrom
lessw2020:add-color-to-console-outputs

Conversation

@lessw2020

Copy link
Copy Markdown
Contributor

Current console output is a sea of white.
Added very simple color and style dataclass in utils, so we (or future users) can enable more informative (and fun) console outputs.

current:
Screenshot 2024-02-23 at 3 15 05 PM

after (not necessarily the 'final' color scheme, just showing the difference here):
Screenshot 2024-02-23 at 2 56 43 PM

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 23, 2024
@lessw2020

Copy link
Copy Markdown
Contributor Author

lint issue is related to new CI rather than pr.

@yifuwang yifuwang left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks very good!

Comment thread train.py Outdated
model_name = job_config.model.name
rank0_log(f"Building {model_name}")
model_name = job_config.model
rank0_log(f"{color.yellow} Building {model_name} {color.reset}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not a blocker, but maybe consider checking if we are being redirected when applying color to avoid '\033[33m' in logs w/ MAST/SLURM.

os.isatty(sys.stdout.fileno())

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good point, thanks for flagging this Yifu!

@lessw2020 lessw2020 closed this Feb 27, 2024
@lessw2020
lessw2020 force-pushed the add-color-to-console-outputs branch from 1198e76 to 5dec536 Compare February 27, 2024 04:40
wconstab added a commit that referenced this pull request Aug 8, 2025
weifengpy added a commit to weifengpy/torchtitan-flexshard that referenced this pull request Oct 20, 2026
The flex_shard PRs this fork uses have landed on meta-pytorch/flex_shard
main: pytorch#51 through pytorch#77, ending at 7cdaf16 (pytorch#48 to pytorch#62 were re-landed as pytorch#96
to pytorch#103). The DeepSeek V3 16B reproduction now installs FlexShard from main
instead of gh/weifengpy/55/head, the head of pytorch#65, which lacks pytorch#66 to pytorch#77:
torchtitan-flexshard#20's fake backend for a size-1 edp_shard needs pytorch#71, and
this fork's DistMuon (#22 to #27) needs pytorch#73 to pytorch#77.

Checked: pip resolves git+https://github.com/meta-pytorch/flex_shard.git@main,
and the fork's main (fa7a9b1) passes its 18 FlexShard and 9 DistMuon GPU
tests (tests/unit_tests/gpu/test_flex_shard.py,
tests/unit_tests/gpu/flex_shard/test_dist_muon.py) against flex_shard 7cdaf16.

ghstack-source-id: 09ed3f5
ghstack-comment-id: 6284173360
Pull-Request: #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants