diff --git a/benchmarks/sizing/utils.py b/benchmarks/sizing/utils.py index 18c4379..2d7edc3 100644 --- a/benchmarks/sizing/utils.py +++ b/benchmarks/sizing/utils.py @@ -1,6 +1,7 @@ import sys import torch import numpy as np +from pathlib import Path from megatron.model import LayerNorm from megatron.model.fused_softmax import FusedScaleMaskSoftmax, SoftmaxFusionTypes from megatron.model.transformer import ParallelSelfAttention, ParallelMLP, ParallelTransformerLayer @@ -11,6 +12,7 @@ class Tee(object): def __init__(self, filename, verbose): + Path(filename).resolve().parent.mkdir(parents=True, exist_ok=True) self.file = open(filename, "w") self.verbose = verbose if self.verbose: