Skip to content

Commit

Permalink
[fix] output file breakage (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
stas00 authored Feb 16, 2024
1 parent 3d3011e commit 3c075f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions benchmarks/sizing/utils.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 3c075f4

Please sign in to comment.