Skip to content

Instantly share code, notes, and snippets.

View leslie-fang-intel's full-sized avatar

Leslie Fang leslie-fang-intel

  • INTC
  • Shanghai
View GitHub Profile
import requests
import torch
print(torch.__version__, flush=True)
import torch.nn as nn
import os, pickle
import numpy as np
import torch._inductor.config as config
import torch._dynamo.config as dynamo_config
import gc
import time
# AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from cmath import nanj
from torch._inductor.hooks import run_intermediate_hooks
import torch
import torch._inductor.config as config
config.freezing = True
in_feature = 32
out_feature = 64
q_min, q_max = -32, 31
reshape_a = True
expand_a_scale = False
import requests
import torch
print(torch.__version__)
import torch.nn as nn
import os, pickle
import numpy as np
import torch._inductor.config as config
config.freezing = True
config.freezing_discard_parameters = True
#include "/tmp/torchinductor_leslie/3b/c3bi5gk6mslf6u4iaqafhxm64z6u65e3eain4xlary5blqnvv6xx.h"
#include <c10/util/Unroll.h>
#include <torch/csrc/inductor/aoti_torch/c/shim.h>
template <int64_t BLOCK_M, int64_t BLOCK_N, bool accum>
inline void kernel_micro_gemm_kernel(
const float* __restrict__ A,
import torch
from torch._inductor import config
batch_size = 4
in_features = 512
out_features = 1024
dtype = torch.bfloat16
# dtype = torch.float16
bias = True
import torch
from torch._inductor.codecache import CppWrapperCodeCache
cpp_wrapper_src = (
'''
#include <optional>
#include <Python.h>
# AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
# AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
# AOT ID: ['0_inference']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile