From 3c075f49dcb9c15e0e58111f3d3667ed943c5080 Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Thu, 15 Feb 2024 19:41:56 -0800 Subject: [PATCH] [fix] output file breakage (#28) --- 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: