Skip to content

Commit

Permalink
Convert logging f-strings to use % format, part three
Browse files Browse the repository at this point in the history
This does triple-quoted strings.

Signed-off-by: Edward Z. Yang <ezyangmeta.com>

ghstack-source-id: 85280b6d70ad4f506fb4aa83e001058ebbab385e
Pull Request resolved: #98704
  • Loading branch information
ezyang committed Apr 9, 2023
1 parent 063143c commit 3ddcce5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion torch/backends/xeon/run_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def main(args):
launcher = _Launcher()
launcher.launch(args)
for x in sorted(set(os.environ.keys()) - env_before):
logger.debug("{x}={os.environ[x]}")
logger.debug("%s=%s", x, os.environ[x])

if __name__ == "__main__":
parser = ArgumentParser(description="This is a script for launching PyTorch inference on Intel(R) Xeon(R) Scalable "
Expand Down
12 changes: 6 additions & 6 deletions torch/distributed/checkpoint/default_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ def _validate_global_plan(
if not _check_box_bounds(value.size, chunk0):
logger.warning(
f"""
key:{key} has out of bounds chunk:
tensor-size:{value.size} chunk: {chunk0}
"""
key:%s has out of bounds chunk:
tensor-size:%s chunk: %s
""", key, value.size, chunk0
)
all_good = False
chunks_volume += reduce(operator.mul, chunk0.sizes, 1)
Expand All @@ -430,9 +430,9 @@ def _validate_global_plan(
if chunks_volume != tensor_volume:
logger.warning(
f"""
key:{key} invalid fill tensor-volume:
{tensor_volume} chunks-volume: {chunks_volume}
"""
key:%s invalid fill tensor-volume:
%s chunks-volume: %s
""", key, tensor_volume, chunks_volume
)
all_good = False

Expand Down

0 comments on commit 3ddcce5

Please sign in to comment.