ncu --list-sets # The configuration for sets. A set defines a set of sections.
ncu --list-sections # The configuration for sections. A section defines a set of metrics.
ncu --query-metrics # All individual metrics.
ncu --query-metrics-mode suffix --metrics <metrics list> # Check various suffixes for a base metric name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass | |
@dataclass | |
class Args: | |
vocab_size: int = 129280 | |
dim: int = 7168 | |
inter_dim: int = 18432 | |
moe_inter_dim: int = 2048 | |
n_layers: int = 61 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch._inductor.config | |
import time | |
torch._inductor.config.triton.cudagraphs = False | |
torch.set_float32_matmul_precision('high') | |
def bench(f, name=None, iters=100, warmup=5, display=True, profile=False): | |
for _ in range(warmup): | |
f() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import torch | |
import torch.nn as nn | |
from torch.nn import functional as F | |
class RelativePositionBias(nn.Module): | |
def __init__(self, bidirectional=True, num_buckets=32, max_distance=128, n_heads=2): | |
super(RelativePositionBias, self).__init__() | |
self.bidirectional = bidirectional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np # import numpy library | |
from util.paramInitializer import initialize_parameters # import function to initialize weights and biases | |
class LinearLayer: | |
""" | |
This Class implements all functions to be executed by a linear layer | |
in a computational graph | |
Args: |