From 5066670cf9d2299c44d610bbcf360da82bc9fe71 Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Thu, 15 Feb 2024 19:39:18 -0800 Subject: [PATCH] [fix] output file breakage --- benchmarks/sizing/utils.py | 2 ++ 1 file changed, 2 insertions(+) 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: