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 inspect | |
from typing import Any, Callable, Dict, List, Optional, Tuple, Union | |
import PIL.Image | |
import torch | |
from transformers import CLIPTextModel, CLIPTextModelWithProjection, CLIPTokenizer | |
from diffusers import StableDiffusionXLImg2ImgPipeline | |
from diffusers.image_processor import PipelineImageInput, VaeImageProcessor | |
from diffusers.loaders import FromSingleFileMixin, StableDiffusionXLLoraLoaderMixin, TextualInversionLoaderMixin |
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
#include <cublas_v2.h> | |
#include <cstdint> | |
#include <cuda.h> | |
#include <cuda_runtime.h> | |
#include <cuda_fp16.h> | |
#include <iostream> | |
#include <torch/torch.h> | |
#include <torch/types.h> | |
#include <c10/util/Half.h> |
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
#include <cublas_v2.h> | |
#include <cstdint> | |
#include <cuda.h> | |
#include <cuda_runtime.h> | |
#include <cuda_fp16.h> | |
#include <iostream> | |
#include <torch/torch.h> | |
#include <torch/types.h> | |
#include <c10/util/Half.h> |
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
#include <cublas_v2.h> | |
#include <cstdint> | |
#include <cuda.h> | |
#include <cuda_runtime.h> | |
#include <cuda_fp16.h> | |
#include <iostream> | |
#include <torch/torch.h> | |
#include <torch/types.h> | |
#include <c10/util/Half.h> |
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
#include <cublas_v2.h> | |
#include <cstdint> | |
#include <cuda.h> | |
#include <cuda_runtime.h> | |
#include <cuda_fp16.h> | |
#include <iostream> | |
#include <torch/torch.h> | |
#include "cutlass/cutlass.h" | |
#include "cutlass/gemm/device/gemm_splitk_parallel.h" |
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
#include <torch/extension.h> | |
#include <cutlass/gemm/gemm.h> | |
#include <cutlass/epilogue/thread/linear_combination.h> | |
torch::Tensor bmm_fp16_fp16_f32(torch::Tensor A, torch::Tensor B, float alpha) { | |
int batch_size = A.size(0); | |
int M = A.size(1); | |
int N = B.size(1); | |
int K = A.size(2); |
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
#include <iostream> | |
#include "cutlass/cutlass.h" | |
#include "cutlass/gemm/device/gemm.h" | |
#include "cutlass/util/host_tensor.h" | |
#include "cutlass/util/reference/host/tensor_compare.h" | |
#include "cutlass/util/reference/host/tensor_copy.h" | |
#include "cutlass/util/reference/host/tensor_fill.h" | |
#include "cutlass/util/tensor_view_io.h" | |
#include "helper.h" |
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 | |
from inference import CaiInferenceConfig, convert_to_ds_model, recover_from_ds_model | |
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer | |
from argparse import ArgumentParser | |
import time | |
import torch | |
from torch.profiler import profile, record_function, ProfilerActivity | |
parser = ArgumentParser() | |
parser.add_argument("--name", default="bigscience/bloom-560m", type=str, help="model_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
import torch | |
import time | |
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer | |
from argparse import ArgumentParser | |
from transformers import LlamaForCausalLM, LlamaTokenizer | |
from inference import CaiInferenceConfig, convert_to_ds_model, recover_from_ds_model | |
from torch.profiler import profile, record_function, ProfilerActivity | |
from types import MethodType | |
from typing import Optional, Sequence, Tuple, Union | |
import torch |
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 pytest | |
import torch | |
import triton | |
import triton.language as tl | |
@triton.jit | |
def max_fn(x, y): | |
return tl.math.max(x, y) |