Skip to content

Instantly share code, notes, and snippets.

View Birch-san's full-sized avatar

Birch-san

View GitHub Profile
@Birch-san
Birch-san / autograd.txt
Created September 20, 2022 00:37
stable-diffusion textual inversion training autograd anomaly
/Users/birch/anaconda3/envs/ldmwaifu-stable/lib/python3.10/site-packages/torch/autograd/__init__.py:173: UserWarning: Error detected in NativeLayerNormBackward0. Traceback of forward call that caused the error:
File "/Users/birch/anaconda3/envs/ldmwaifu-stable/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/birch/anaconda3/envs/ldmwaifu-stable/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/birch/.vscode/extensions/ms-python.python-2022.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
cli.main()
File "/Users/birch/.vscode/extensions/ms-python.python-2022.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/Users/birch/.vscode/extensions/ms-python.python-2022.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../d
@Birch-san
Birch-san / nightly.txt
Created September 19, 2022 18:38
8 steps, Heun sampler, stable-diffusion, PyTorch nightly 1.13.0.dev20220917
------------------------------------------------------- ------------ ------------ ------------ ------------ ------------ ------------
Name Self CPU % Self CPU CPU total % CPU total CPU time avg # of Calls
------------------------------------------------------- ------------ ------------ ------------ ------------ ------------ ------------
job 0.27% 29.274ms 100.00% 10.976s 10.976s 1
iteration 0.00% 135.000us 98.68% 10.831s 10.831s 1
batch 0.92% 101.481ms 98.68% 10.831s 10.831s 1
kdiff_sample 0.00% 281.000us 93.19% 10.229s 10.229s 1
@Birch-san
Birch-san / stable.txt
Created September 19, 2022 18:37
8 steps, Heun sampler, stable-diffusion, PyTorch stable 1.12.1
------------------------------------------------------- ------------ ------------ ------------ ------------ ------------ ------------
Name Self CPU % Self CPU CPU total % CPU total CPU time avg # of Calls
------------------------------------------------------- ------------ ------------ ------------ ------------ ------------ ------------
job 0.34% 34.856ms 99.99% 10.156s 10.156s 1
iteration 0.00% 169.000us 98.56% 10.010s 10.010s 1
batch 1.67% 169.994ms 98.56% 10.010s 10.010s 1
kdiff_sample 0.00% 299.000us 91.96% 9.340s 9.340s 1
@Birch-san
Birch-san / train.md
Last active September 11, 2022 23:19
Training waifu-diffusion
@Birch-san
Birch-san / gist:6cd1574e51871a5e2b88d59f0f3d4fd3
Created August 31, 2022 00:07
Stable Diffusion DDIM sigmas
supported sigmas:
tensor([ 0.0292, 0.0413, 0.0507, 0.0586, 0.0656, 0.0720, 0.0779, 0.0834,
0.0886, 0.0936, 0.0983, 0.1028, 0.1072, 0.1114, 0.1155, 0.1195,
0.1234, 0.1271, 0.1308, 0.1345, 0.1380, 0.1415, 0.1449, 0.1482,
0.1515, 0.1548, 0.1580, 0.1611, 0.1642, 0.1673, 0.1704, 0.1734,
0.1763, 0.1793, 0.1822, 0.1850, 0.1879, 0.1907, 0.1935, 0.1963,
0.1991, 0.2018, 0.2045, 0.2072, 0.2099, 0.2125, 0.2152, 0.2178,
0.2204, 0.2230, 0.2256, 0.2281, 0.2307, 0.2332, 0.2358, 0.2383,
0.2408, 0.2433, 0.2458, 0.2482, 0.2507, 0.2531, 0.2556, 0.2580,
0.2604, 0.2628, 0.2653, 0.2677, 0.2700, 0.2724, 0.2748, 0.2772,
from torch.nn import Embedding
from typing import Tuple, TypeVar, Iterable
from typing_extensions import TypeAlias
from enum import Enum, auto
from math import ceil
from torch import BoolTensor, LongTensor, sparse_coo_tensor, ones
from itertools import chain
class Label(Enum):
@Birch-san
Birch-san / palette.txt
Created July 3, 2022 17:18
Danbooru tags for describing Walfie characters
::a-chan_(hololive)
blue_bow bow hair_bow short_hair black-framed_eyewear
black_jacket id_card lanyard
official_alternate_costume
::smol_ame watson_amelia
brown_footwear blonde_hair skirt brown_skirt necktie red_necktie shirt white_shirt short_hair kneehighs grey_legwear long_sleeves cabbie_hat bangs plaid_skirt
brown_jacket
::smol_gura gawr_gura
@Birch-san
Birch-san / walfie-booru.tsv
Created July 3, 2022 17:10
Walfie danbooru tags
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 22 columns, instead of 43 in line 1.
A_chan.gif[FRAMES:]6[GENERAL_PICKN:]smile blue_bow bow hair_bow black_jacket id_card lanyard solo glasses purple_hair bangs black-framed_eyewear 1girl official_alternate_costume short_hair transparent_background closed_mouth chibi[GENERAL_CRUCIAL:]typing laptop upper_body[PROPER_NOUNS:]a-chan_(hololive) walfie_(style)
a_way_out.gif[FRAMES:]5[GENERAL_PICKN:]brown_footwear blonde_hair skirt brown_skirt closed_mouth necktie red_necktie shirt white_shirt smile short_hair transparent_background kneehighs shark_tail hood hood_down hoodie shark_girl silver_hair tail fish_tail chibi blue_hoodie grey_hair long_hair grey_legwear long_sleeves cabbie_hat bangs plaid_skirt[GENERAL_CRUCIAL:]2girls multiple_girls locked_arms abseiling escape falling full_body |_| ._.[PROPER_NOUNS:]smol_gura gawr_gura smol_ame watson_amelia walfie_(style)
Ame_Birthday_2022.gif[FRAMES:]30[GENERAL_PICKN:]brown_footwear blonde_hair skirt brown_skirt closed_mouth necktie red_necktie shirt white_shirt smile short_hair kneehighs grey_legwear tra
@Birch-san
Birch-san / test.mlir
Created June 25, 2022 23:21
failed to legalize operation 'arith.cmpi'
This file has been truncated, but you can view the full file.
#loc0 = loc(unknown)
module @pmap_p_generate.14 {
func.func public @main(%arg0: tensor<1x64xi32> loc(unknown), %arg1: tensor<1x64xi32> loc(unknown), %arg2: tensor<1x64xi32> loc(unknown), %arg3: tensor<1x64xi32> loc(unknown), %arg4: tensor<2xui32> loc(unknown), %arg5: tensor<2048x16416xf32> loc(unknown), %arg6: tensor<256x2048xf32> loc(unknown), %arg7: tensor<16416x2048xf32> loc(unknown), %arg8: tensor<2048xf32> loc(unknown), %arg9: tensor<2048xf32> loc(unknown), %arg10: tensor<2048xf32> loc(unknown), %arg11: tensor<24x2048x2048xf32> loc(unknown), %arg12: tensor<24x2048x2048xf32> loc(unknown), %arg13: tensor<24x2048x2048xf32> loc(unknown), %arg14: tensor<24x2048x2048xf32> loc(unknown), %arg15: tensor<24x2048x2048xf32> loc(unknown), %arg16: tensor<24x2048x2048xf32> loc(unknown), %arg17: tensor<24x2048x2048xf32> loc(unknown), %arg18: tensor<24x2048x2048xf32> loc(unknown), %arg19: tensor<24x2048x4096xf32> loc(unknown), %arg20: tensor<24x2048x4096xf32> loc(unknown), %arg21: tensor<24x4096x2048xf32> loc(unknown),
@Birch-san
Birch-san / jit__threefry_split.py
Created June 18, 2022 17:14
MHLO program which compiles on mainline IREE, but which fails to compile on my local install of commit https://github.com/Birch-san/iree/commits/scatter
from iree import compiler
CODE = """
#loc0 = loc(unknown)
module @jit__threefry_split.11 {
func.func public @main(%arg0: tensor<2xui32> loc(unknown)) -> tensor<2x2xui32> {
%0 = "mhlo.iota"() {iota_dimension = 0 : i64} : () -> tensor<4xui32> loc(#loc1)
%1 = "mhlo.slice"(%arg0) {limit_indices = dense<1> : tensor<1xi64>, start_indices = dense<0> : tensor<1xi64>, strides = dense<1> : tensor<1xi64>} : (tensor<2xui32>) -> tensor<1xui32> loc(#loc2)
%2 = "mhlo.reshape"(%1) : (tensor<1xui32>) -> tensor<ui32> loc(#loc3)
%3 = "mhlo.slice"(%arg0) {limit_indices = dense<2> : tensor<1xi64>, start_indices = dense<1> : tensor<1xi64>, strides = dense<1> : tensor<1xi64>} : (tensor<2xui32>) -> tensor<1xui32> loc(#loc4)