Skip to content

Instantly share code, notes, and snippets.

View vivekkhandelwal1's full-sized avatar

Vivek Khandelwal vivekkhandelwal1

View GitHub Profile
iree-compile: vivekkhandelwal1-iree/third_party/llvm-project/llvm/include/llvm/ADT/SmallVector.h:294: llvm::SmallVectorTemplateCommon::reference llvm::SmallVectorTemplateCommon<mlir::OpFoldResult, void>::operator[](llvm::SmallVectorTemplateCommon::size_type) [T = mlir::OpFoldResult]: Assertion `idx < size()' failed.
Please report issues to https://github.com/openxla/iree/issues and include the crash backtrace.
#0 0x00007f40b16e9807 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/vivek/work/02_07/vivekkhandelwal1-iree/third_party/llvm-project/llvm/lib/Support/Unix/Signals.inc:567:13
#1 0x00007f40b16e7a40 llvm::sys::RunSignalHandlers() /home/vivek/work/02_07/vivekkhandelwal1-iree/third_party/llvm-project/llvm/lib/Support/Signals.cpp:105:18
#2 0x00007f40b16e9e8f SignalHandler(int) /home/vivek/work/02_07/vivekkhandelwal1-iree/third_party/llvm-project/llvm/lib/Support/Unix/Signals.inc:412:1
#3 0x00007f40b1f48420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f40a83f300b raise
#loc = loc(unknown)
#loc1 = loc("<eval_with_key>.1064":5:27)
#loc3 = loc("<eval_with_key>.1064":8:16)
#map = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)>
#map1 = affine_map<(d0) -> (d0)>
#map2 = affine_map<(d0, d1, d2, d3) -> (0, 0, 0, 0)>
#map3 = affine_map<(d0, d1, d2, d3) -> (d1, 0, 0)>
#map4 = affine_map<(d0, d1, d2, d3) -> (d2, 0)>
#map5 = affine_map<(d0, d1, d2, d3) -> (d3)>
#map6 = affine_map<(d0, d1) -> (d0, d1)>
module attributes {torch.debug_module_name = "GraphModule"} {
ml_program.global private mutable @global_seed(dense<0> : tensor<i64>) : tensor<i64>
func.func @forward(%arg0: tensor<128x64xf32>, %arg1: tensor<128x64xf32>, %arg2: tensor<128x64xf32>) -> (tensor<128x128xf32>, tensor<128x64xf32>) {
%c0_i64 = arith.constant 0 : i64
%cst = arith.constant dense<8.000000e+00> : tensor<1xf32>
%cst_0 = arith.constant dense<[-0.0894111692, 0.103848457, -0.00917740166, -0.0244901776, 0.119258568, -0.00977316498, 0.0377134234, 0.0989970862, -0.00481572747, -0.00710386038, 0.0655511767, -0.0383401811, 0.0421119481, -0.00571197271, -0.10521102, 0.0791201741, 0.00863443315, -0.0128559023, -0.0606819838, 0.0937583446, -0.0209991932, -0.0510840565, 0.0324939042, 0.0960267782, 0.0424099565, 0.0397028774, -0.117266938, 0.00175793469, 0.118694231, 0.0152140111, 0.00489573181, -0.11549978, -0.00344143808, 0.0712423772, -0.105980158, 0.0484703034, 0.0748086423, -0.0141288787, 0.0825159251, 0.0163007528, 6.141980e-02,
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
# import sys
# from typing import List
# from PIL import Image
# import requests
# Textual-inversion fine-tuning for Stable Diffusion using diffusers
# This script shows how to "teach" Stable Diffusion a new concept via
# textual-inversion using 🤗 Hugging Face [🧨 Diffusers library](https://github.com/huggingface/diffusers).
# By using just 3-5 images you can teach new concepts to Stable Diffusion
# and personalize the model on your own images.
# pip install diffusers["training"]==0.4.1 transformers ftfy opencv-python
# pip install opencv-python diffusers ftfy spacy accelerate
import argparse
module attributes {torch.debug_module_name = "GraphModule"} {
func.func @forward(%arg0: !torch.vtensor<[128,3,3,3],f32>, %arg1: !torch.vtensor<[128],f32>, %arg2: !torch.vtensor<[128],f32>, %arg3: !torch.vtensor<[128],f32>, %arg4: !torch.vtensor<[128,128,3,3],f32>, %arg5: !torch.vtensor<[128],f32>, %arg6: !torch.vtensor<[128],f32>, %arg7: !torch.vtensor<[128],f32>, %arg8: !torch.vtensor<[128,128,3,3],f32>, %arg9: !torch.vtensor<[128],f32>, %arg10: !torch.vtensor<[128],f32>, %arg11: !torch.vtensor<[128],f32>, %arg12: !torch.vtensor<[128,128,3,3],f32>, %arg13: !torch.vtensor<[128],f32>, %arg14: !torch.vtensor<[128],f32>, %arg15: !torch.vtensor<[128],f32>, %arg16: !torch.vtensor<[128,128,3,3],f32>, %arg17: !torch.vtensor<[128],f32>, %arg18: !torch.vtensor<[128,128,3,3],f32>, %arg19: !torch.vtensor<[128],f32>, %arg20: !torch.vtensor<[128],f32>, %arg21: !torch.vtensor<[128],f32>, %arg22: !torch.vtensor<[256,128,3,3],f32>, %arg23: !torch.vtensor<[256],f32>, %arg24: !torch.vtensor<[256],f32>, %arg25: !torch.vtensor
import torch
import torch_mlir
from torch_mlir_e2e_test.linalg_on_tensors_backends import refbackend
torch.manual_seed(0)
grad_out = torch.randn((1, 4, 64, 64))
input_vec = torch.randn((1, 320, 64, 64))
weight = torch.randn((4, 320, 3, 3))
import torch
import torch_mlir
from torch_mlir_e2e_test.linalg_on_tensors_backends import refbackend
torch.manual_seed(0)
grad_out = torch.randn((1, 320, 32, 32))
input_vec = torch.randn((1, 320, 64, 64))
weight = torch.randn((320, 320, 3, 3))
This file has been truncated, but you can view the full file.
module attributes {torch.debug_module_name = "train_func"} {
func.func private @__torch__.torch.fx.graph_module.train_func.__code_getter(%arg0: !torch.nn.Module<"__torch__.torch.fx.graph_module.train_func">) -> !torch.str {
%995 = torch.prim.GetAttr %arg0["_code"] : !torch.nn.Module<"__torch__.torch.fx.graph_module.train_func"> -> !torch.str
return %995 : !torch.str
}
func.func private @__torch__.torch.fx.graph_module.train_func.forward(%arg0: !torch.nn.Module<"__torch__.torch.fx.graph_module.train_func">, %arg1: !torch.tensor {torch.type_bound = !torch.vtensor<[1,77],si64>}, %arg2: !torch.tensor {torch.type_bound = !torch.vtensor<[1,3,512,512],f32>}) -> !torch.tensor {
%float-2.000000e-02 = torch.constant.float -0.020000000000000004
%str_0 = torch.constant.str "none"
%float-9.210340e00 = torch.constant.float -9.2103403719761836
%int6 = torch.constant.int 6
#!/usr/bin/env python3
"""Samples from k-diffusion models."""
import argparse
import math
import accelerate
import torch
from tqdm import trange, tqdm