Skip to content

Commit

Permalink
Merge pull request #1 from mikolajblaz/customize-submission
Browse files Browse the repository at this point in the history
Allow customizing submission ORG and PLATFORM via env vars
  • Loading branch information
matthew-frank authored Sep 7, 2022
2 parents a2dea84 + d7fb837 commit 7112e7b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions mlperf_common/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,28 @@ def log_weights_initialization(self, tensor_name):
self.event(key=constants.WEIGHTS_INITIALIZATION,
metadata=dict(tensor=tensor_name), internal_call=True)

def mlperf_submission_log(self, benchmark, num_nodes=None):
def mlperf_submission_log(self, benchmark, num_nodes=None, org=None,
platform=None):
""" Helper for logging submission entry. """
if num_nodes is None:
num_nodes = os.environ.get('SLURM_JOB_NUM_NODES', 1)

if org is None:
org = os.environ.get('MLPERF_SUBMISSION_ORG',
'SUBMISSION_ORG_PLACEHOLDER')

if platform is None:
platform = os.environ.get('MLPERF_SUBMISSION_PLATFORM',
'SUBMISSION_PLATFORM_PLACEHOLDER')

self.event(
key=constants.SUBMISSION_BENCHMARK,
value=benchmark,
internal_call=True)

self.event(
key=constants.SUBMISSION_ORG,
value='NVIDIA',
value=org,
internal_call=True)

self.event(
Expand All @@ -121,6 +130,6 @@ def mlperf_submission_log(self, benchmark, num_nodes=None):

self.event(
key=constants.SUBMISSION_PLATFORM,
value=f'{num_nodes}xSUBMISSION_PLATFORM_PLACEHOLDER',
value=f'{num_nodes}x{platform}',
internal_call=True)

0 comments on commit 7112e7b

Please sign in to comment.