Commit Graph
55 Commits
Author SHA1 Message Date
George HotzandGitHub ed1963b899 Fast DiskTensor to other Tensor (#916)
* make disktensors fast

* loading

* loader for sd and llama
2023-06-03 12:25:41 -07:00
geohot 46d419060b start on mlperf models 2023-05-10 16:30:49 -07:00
KirillandGitHub 0fe5014b1f Use pathlib (#711)
* Use pathlib in llama

* Use pathlib in stablediffusion
2023-03-18 13:49:21 -07:00
KirillandGitHub af7745073f Add comments to SD (#686)
* Add explanation for empty lambdas

* Fix my_unpickle if pytorch_lightning is installed

* oops
2023-03-12 10:56:49 -07:00
George HotzandGitHub b1206bcb18 third try at torch loading (#677)
* third try at torch loading

* numpy fixed

* fix enet compile

* load_single_weight supports empty weights

* oops, CPU wasn't the default

* so many bugs
2023-03-10 19:11:29 -08:00
geohot 8bf75a7fdd fix stable diffusion and CI 2023-03-10 17:48:12 -08:00
Pankaj DohareyandGitHub 9d97d97b26 Opens image in default viewer after saving. (#612) 2023-03-03 17:28:49 -08:00
Jacky LeeandGitHub c35fcc6964 Replace phrase for prompt (#555) 2023-02-12 09:04:44 -08:00
KirillandGitHub 27154db99a Downloads weights in examples/stable_diffusion.py (#537)
* Downloads weights in examples/stable_diffusion.py

* use download_file_if_not_exists in fetch

* make consistent with previous NOCACHE behavior
2023-02-10 14:37:04 -06:00
f08187526f Fix examples (#540)
* Fix examples

* Remove training in parameters

* Simplify a bit

* Remove extra import

* Fix linter errors

* factor out Device

* NumPy-like semantics for Tensor.__getitem__ (#506)

* Rewrote Tensor.__getitem__ to fix negative indices and add support for np.newaxis/None

* Fixed pad2d

* mypy doesn't know about mlops methods

* normal python behavior for out-of-bounds slicing

* type: ignore

* inlined idxfix

* added comment for __getitem__

* Better comments, better tests, and fixed bug in np.newaxis

* update cpu and torch to hold buffers (#542)

* update cpu and torch to hold buffers

* save lines, and probably faster

* Mypy fun (#541)

* mypy fun

* things are just faster

* running fast

* mypy is fast

* compile.sh

* no gpu hack

* refactor ops_cpu and ops_torch to not subclass

* make weak buffer work

* tensor works

* fix test failing

* cpu/torch cleanups

* no or operator on dict in python 3.8

* that was junk

* fix warnings

* comment and touchup

* dyn add of math ops

* refactor ops_cpu and ops_torch to not share code

* nn/optim.py compiles now

* Reorder imports

* call mkdir only if directory doesn't exist

---------

Co-authored-by: George Hotz <[email protected]>
Co-authored-by: Mitchell Goff <[email protected]>
Co-authored-by: George Hotz <[email protected]>
2023-02-10 12:09:37 -06:00
geohot 5e37f084db stable diffusion: clean up constant folding 2023-02-01 12:53:16 -08:00
Jacky LeeandGitHub 486f023e81 Rename Normalize and move to nn (#513)
* Rename Normalize and move to nn

* Match PyTorch for dim>1
2023-02-01 11:55:03 -08:00
George HotzandGitHub 487685919b Revert "Rename Normalize and move to nn (#415)" (#474)
This reverts commit d768acb6a9.
2023-01-25 07:50:04 -08:00
Jacky LeeandGitHub d768acb6a9 Rename Normalize and move to nn (#415)
* Rename Normalize and move to nn

* Fix comparison to None error

* Add test for GroupNorm

* Rename test case

* Flip parameters to match PyTorch

* Increase error tolerance

* Fix elementwise_affine on channels

* Match arguments with PyTorch

* Initialize weight and bias only when affine is true

* Is this it?

* A bit cleaner

* Handle case where weight or bias is None
2023-01-25 07:47:59 -08:00
George Hotz 6d7658db12 delete opencl <celebration> 2023-01-24 14:18:35 -08:00
nogiraandGitHub 2e744ef2f2 confirmed (#449)
w/ a bunch of print statements in the official model here: https://github.com/CompVis/stable-diffusion/blob/ce05de28194041e030ccfc70c635fe3707cdfc30/ldm/modules/diffusionmodules/openaimodel.py#L413
2023-01-07 08:41:06 -08:00
Drew HintzandGitHub 165fb4d631 remove redundant list comprehension from inside all. (#397)
remove explicit inherit from object.
2022-10-13 09:58:35 -07:00
geohot 178ba50c03 some args for stable diffusion 2022-09-29 01:52:04 -04:00
George HotzandGitHub 60df954377 Fix weight init: this work? (#391)
* this work?

* glorot uniform

* requies_grad broke

* propagate the None correctly

* so this weight init works

* ahh, i think it's this

* can't beat this

* glorot is best for ae

* remove comments
2022-09-25 16:46:33 -04:00
geohot 894a7cee79 forgot a few 2022-09-12 09:21:46 -07:00
geohot 801ecd4a07 cleanup clip tokenizer 2022-09-12 09:20:12 -07:00
Fernand PajotandGitHub ff0da4c802 Added standalone CLIP tokenizer (#382)
* Added standalone CLIP tokenizer.

* Fixed empty phrase.

* Truncating long prompts.

* Keeping two slots for the start and end token.

* Fixed empty phrase.

* Using tokenizer for empty phrase.

* Typo.
2022-09-12 09:12:55 -07:00
George Hotz ecc1a0470d add Linear to tinygrad.nn 2022-09-07 07:40:48 -07:00
George Hotz 896f9f74a9 hmm, need this with broadcast change 2022-09-06 16:54:01 -07:00
George Hotz a18a6a0773 fix sd with TORCH=1 2022-09-06 16:51:16 -07:00
George Hotz 0516359af8 fix stupid OPENCL=1 OOM 2022-09-06 14:29:23 -07:00
George Hotz f215534a64 1100 lines, but sane linter rules 2022-09-06 13:47:45 -07:00
George Hotz 682dc64430 works at work 2022-09-06 08:06:11 -07:00
geohot d6f499fd69 improve opencl, why is it OOMing 2022-09-05 20:14:31 -07:00
geohot 0ba6179de7 stable diffusion in readme 2022-09-05 18:51:56 -07:00
geohot c1d5af8b0c stable diffusion cleanups 2022-09-05 18:34:13 -07:00
geohot 3728ef6d02 better alphas 2022-09-05 16:48:26 -07:00
geohot 0fda854b3e other prompt example 2022-09-05 16:14:16 -07:00
geohot 16cb4290c4 cat horse winning 2022-09-05 16:05:14 -07:00
geohot 1043fa067a it renders something 2022-09-05 15:52:14 -07:00
geohot 5a685b93ac brown img 2022-09-05 15:20:18 -07:00
geohot 98d6264987 all models match 2022-09-05 12:27:54 -07:00
geohot b8bd34b5d2 fix last bug in unet probz 2022-09-05 11:32:44 -07:00
geohot 3df67aa0af fix transformer bugs 2022-09-05 11:26:32 -07:00
geohot 2ed3bb6223 clip model is running 2022-09-05 11:26:32 -07:00
geohot 1a54ea2417 runs on torch cpu 2022-09-04 12:06:42 -07:00
geohot 9590d92750 stable diffusion compiles (add no_init) 2022-09-04 11:40:50 -07:00
geohot 172683c314 work 2022-09-04 11:21:09 -07:00
geohot c2a030fe55 one liner that's more clear 2022-09-03 16:08:48 -07:00
geohot 4a3ed58edb more readable actually 2022-09-03 16:00:35 -07:00
geohot 633f31dc73 easier to read 2022-09-03 15:53:58 -07:00
geohot 6578e08919 cleanups for Mid 2022-09-03 15:50:33 -07:00
geohot 852de7c66c remove ugly parens 2022-09-03 15:41:37 -07:00
geohot 6b190c2fa5 stable diffusion works 2022-09-03 13:55:36 -07:00
geohot 947e10dab0 yolo 2022-09-03 12:39:48 -07:00