diff --git a/Cargo.lock b/Cargo.lock index a77dcf9..2f0dadb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,15 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anes" version = "0.1.6" @@ -30,12 +39,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] -name = "arbitrary" -version = "1.4.1" +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "ash" +version = "0.38.0+1.3.281" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" +dependencies = [ + "libloading", +] + +[[package]] +name = "async-channel" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ - "derive_arbitrary", + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", ] [[package]] @@ -44,6 +71,21 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "1.3.2" @@ -52,9 +94,18 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +dependencies = [ + "serde", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "bumpalo" @@ -88,28 +139,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "candle-core" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef79e00300acaaa6b0b33168e2ed5050f06125d1add87e7103c40a119083581" -dependencies = [ - "byteorder", - "gemm 0.17.1", - "half", - "memmap2", - "num-traits", - "num_cpus", - "rand 0.8.5", - "rand_distr 0.4.3", - "rayon", - "safetensors", - "thiserror", - "ug", - "yoke", - "zip", -] - [[package]] name = "cast" version = "0.3.0" @@ -122,6 +151,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "ciborium" version = "0.2.2" @@ -174,31 +209,69 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +[[package]] +name = "codespan-reporting" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" +dependencies = [ + "serde", + "termcolor", + "unicode-width", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "constensor-core" version = "0.1.1" dependencies = [ - "candle-core", "criterion", + "cubecl", "cudarc", - "dirs", - "gemm 0.18.2", + "dirs 5.0.1", + "gemm", "half", "num_cpus", "petgraph", - "rand 0.9.1", - "rand_distr 0.5.1", + "rand", + "rand_distr", "rayon", - "thiserror", + "thiserror 1.0.61", ] [[package]] -name = "crc32fast" -version = "1.4.2" +name = "core-foundation" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ - "cfg-if", + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "libc", ] [[package]] @@ -237,6 +310,12 @@ dependencies = [ "itertools", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + [[package]] name = "crossbeam-deque" version = "0.8.5" @@ -268,25 +347,384 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "cubecl" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418aabe526efb2d2714b9282a583bccbc555fe2e42546101259b2042bc133fa" +dependencies = [ + "cubecl-convolution", + "cubecl-core", + "cubecl-cuda", + "cubecl-hip", + "cubecl-matmul", + "cubecl-runtime", + "cubecl-std", + "cubecl-wgpu", + "half", +] + +[[package]] +name = "cubecl-common" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2bed7d9aa1a2fe640696067cab6b0b1b40dd30cdb8d12f91ae43ca6392498e" +dependencies = [ + "bytemuck", + "cfg-if", + "derive-new", + "derive_more", + "dirs 6.0.0", + "embassy-futures", + "embassy-time", + "futures-lite", + "half", + "hashbrown", + "log", + "num-traits", + "portable-atomic", + "rand", + "sanitize-filename", + "serde", + "serde_json", + "spin", + "wasm-bindgen-futures", + "web-time", +] + +[[package]] +name = "cubecl-convolution" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a324c7e684c627a2746fb4700a29b5881970c7f93cc06c66bcf3c2c5184af97b" +dependencies = [ + "bytemuck", + "cubecl-common", + "cubecl-core", + "cubecl-matmul", + "cubecl-random", + "cubecl-reduce", + "cubecl-runtime", + "cubecl-std", + "half", + "serde", +] + +[[package]] +name = "cubecl-core" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc4c683bb3ed715eed12cfeca6599dc554efb9371e85f783eb7c3ae0d3781274" +dependencies = [ + "bitflags 2.9.0", + "bytemuck", + "cubecl-common", + "cubecl-ir", + "cubecl-macros", + "cubecl-runtime", + "derive-new", + "derive_more", + "half", + "hashbrown", + "log", + "num-traits", + "paste", + "serde", + "serde_json", + "variadics_please", +] + +[[package]] +name = "cubecl-cpp" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d06ed3e34f0a9f0a1ca225fc3351865a2ddf66966c73a7953dd27f1bbaed9b9" +dependencies = [ + "bytemuck", + "cubecl-common", + "cubecl-core", + "cubecl-runtime", + "derive-new", + "half", + "log", +] + +[[package]] +name = "cubecl-cuda" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf8898be518bd3df9f7d0df8c25e95f07cfc087c6485dda42e99add432e3463b" +dependencies = [ + "bytemuck", + "cubecl-common", + "cubecl-core", + "cubecl-cpp", + "cubecl-runtime", + "cudarc", + "derive-new", + "half", + "log", + "serde", +] + +[[package]] +name = "cubecl-hip" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9afb1c085f8d715fd8686ad77ada69e364c9cc16a51cf10a7d65ad88d760b6b" +dependencies = [ + "bytemuck", + "cubecl-common", + "cubecl-core", + "cubecl-cpp", + "cubecl-hip-sys", + "cubecl-runtime", + "derive-new", + "half", + "log", + "paste", + "serde", +] + +[[package]] +name = "cubecl-hip-sys" +version = "6.4.4348201" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678a20e5e38ce9c772bdd53596f2801ef210ae735ec2d7d46b5d5b675c09d929" +dependencies = [ + "libc", + "regex", +] + +[[package]] +name = "cubecl-ir" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb72454fb17da66e60f98a011cce199ff0bb78c4e465236459af619039b6cd5" +dependencies = [ + "cubecl-common", + "cubecl-macros-internal", + "derive_more", + "float-ord", + "fnv", + "half", + "hashbrown", + "num-traits", + "portable-atomic", + "serde", + "variadics_please", +] + +[[package]] +name = "cubecl-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d61316b8a2ec26bb554745591174022bb048dbcc508091b15dd4f6fcb4793a" +dependencies = [ + "cubecl-common", + "darling", + "derive-new", + "ident_case", + "prettyplease", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cubecl-macros-internal" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c27cf02393d78a41ad125ef6d6274cd3930385f6945779f4f21a2c66e718db" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cubecl-matmul" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66af2716f458eed3bd14d810d9a90bc43dd35c5464b2fe4630a711a074892fb8" +dependencies = [ + "bytemuck", + "cubecl-common", + "cubecl-core", + "cubecl-random", + "cubecl-reduce", + "cubecl-runtime", + "cubecl-std", + "half", + "serde", +] + +[[package]] +name = "cubecl-random" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "648731639463df215c01ee209477a2f233fb5168fb50e8df755e658ddaaf29f4" +dependencies = [ + "cubecl-common", + "cubecl-core", + "cubecl-runtime", + "cubecl-std", + "half", + "num-traits", + "rand", + "serde", +] + +[[package]] +name = "cubecl-reduce" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "729e3de15783aed5c617c8c4de633765c6d0cf4b9564bb51d21dd67b4fdeeebf" +dependencies = [ + "cubecl-core", + "cubecl-runtime", + "cubecl-std", + "half", + "num-traits", + "serde", +] + +[[package]] +name = "cubecl-runtime" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab7c56cbb83e43fd1b52ee3d521bcb816068e0bb6f4aeb56c9bd63218b1147" +dependencies = [ + "async-channel", + "bytemuck", + "cfg-if", + "cfg_aliases", + "cubecl-common", + "cubecl-ir", + "derive-new", + "dirs 6.0.0", + "foldhash", + "hashbrown", + "log", + "md5", + "serde", + "serde_json", + "spin", + "toml", + "variadics_please", + "wasm-bindgen-futures", +] + +[[package]] +name = "cubecl-std" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3536c4c1c878bd77ceda959a3f157bbb69f957269e3f138c7edd72d9deb533fd" +dependencies = [ + "cubecl-core", + "cubecl-runtime", + "half", + "serde", +] + +[[package]] +name = "cubecl-wgpu" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3f068c9a81201f43cdd3f6385201b330f2499f6c24d688d82a70d705261a32" +dependencies = [ + "async-channel", + "bytemuck", + "cfg-if", + "cfg_aliases", + "cubecl-common", + "cubecl-core", + "cubecl-cpp", + "cubecl-runtime", + "derive-new", + "derive_more", + "half", + "hashbrown", + "log", + "wgpu", +] + [[package]] name = "cudarc" -version = "0.16.1" +version = "0.16.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13f3807b96899cd88fb9feecc41316cd0879df6f2726616ab88a4bc919af7663" +checksum = "17200eb07e7d85a243aa1bf4569a7aa998385ba98d14833973a817a63cc86e92" dependencies = [ "half", "libloading", ] [[package]] -name = "derive_arbitrary" -version = "1.4.1" +name = "darling" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +checksum = "08440b3dd222c3d0433e63e097463969485f112baff337dfdaca043a0d760570" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25b7912bc28a04ab1b7715a68ea03aaa15662b43a1a4b2c480531fd19f8bf7e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce154b9bea7fb0c8e8326e62d00354000c36e79770ff21b8c84e3aa267d9d531" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "derive-new" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ "proc-macro2", "quote", "syn", + "unicode-xid", ] [[package]] @@ -295,7 +733,16 @@ version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "dirs-sys", + "dirs-sys 0.4.1", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys 0.5.0", ] [[package]] @@ -306,29 +753,29 @@ checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", "option-ext", - "redox_users", + "redox_users 0.4.5", "windows-sys 0.48.0", ] [[package]] -name = "displaydoc" -version = "0.2.5" +name = "dirs-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" dependencies = [ - "proc-macro2", - "quote", - "syn", + "libc", + "option-ext", + "redox_users 0.5.2", + "windows-sys 0.59.0", ] [[package]] -name = "dyn-stack" -version = "0.10.0" +name = "document-features" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e53799688f5632f364f8fb387488dd05db9fe45db7011be066fc20e7027f8b" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" dependencies = [ - "bytemuck", - "reborrow", + "litrs", ] [[package]] @@ -346,6 +793,62 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +[[package]] +name = "embassy-futures" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f878075b9794c1e4ac788c95b728f26aa6366d32eeb10c7051389f898f7d067" + +[[package]] +name = "embassy-time" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f820157f198ada183ad62e0a66f554c610cdcd1a9f27d4b316358103ced7a1f8" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-time-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-util", +] + +[[package]] +name = "embassy-time-driver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d45f5d833b6d98bd2aab0c2de70b18bfaa10faf661a1578fd8e5dfb15eb7eba" +dependencies = [ + "document-features", +] + +[[package]] +name = "embedded-hal" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +dependencies = [ + "nb 0.1.3", + "void", +] + +[[package]] +name = "embedded-hal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" + +[[package]] +name = "embedded-hal-async" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" +dependencies = [ + "embedded-hal 1.0.0", +] + [[package]] name = "enum-as-inner" version = "0.6.1" @@ -364,12 +867,51 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + [[package]] name = "fixedbitset" version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" +[[package]] +name = "float-ord" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce81f49ae8a0482e4c55ea62ebbd7e5a686af544c00b9d090bba3ff9be97b3d" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foldhash" version = "0.1.5" @@ -377,123 +919,123 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] -name = "gemm" -version = "0.17.1" +name = "foreign-types" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab24cc62135b40090e31a76a9b2766a501979f3070fa27f689c27ec04377d32" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" dependencies = [ - "dyn-stack 0.10.0", - "gemm-c32 0.17.1", - "gemm-c64 0.17.1", - "gemm-common 0.17.1", - "gemm-f16 0.17.1", - "gemm-f32 0.17.1", - "gemm-f64 0.17.1", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 10.7.0", - "seq-macro", + "foreign-types-macros", + "foreign-types-shared", ] [[package]] -name = "gemm" -version = "0.18.2" +name = "foreign-types-macros" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab96b703d31950f1aeddded248bc95543c9efc7ac9c4a21fda8703a83ee35451" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ - "dyn-stack 0.13.0", - "gemm-c32 0.18.2", - "gemm-c64 0.18.2", - "gemm-common 0.18.2", - "gemm-f16 0.18.2", - "gemm-f32 0.18.2", - "gemm-f64 0.18.2", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 11.5.0", - "seq-macro", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "gemm-c32" -version = "0.17.1" +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "futures-core" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9c030d0b983d1e34a546b86e08f600c11696fde16199f971cd46c12e67512c0" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-lite" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ - "dyn-stack 0.10.0", - "gemm-common 0.17.1", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 10.7.0", - "seq-macro", + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", ] [[package]] -name = "gemm-c32" -version = "0.18.2" +name = "futures-task" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6db9fd9f40421d00eea9dd0770045a5603b8d684654816637732463f4073847" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ - "dyn-stack 0.13.0", - "gemm-common 0.18.2", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 11.5.0", - "seq-macro", + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", ] [[package]] -name = "gemm-c64" -version = "0.17.1" +name = "gemm" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb5f2e79fefb9693d18e1066a557b4546cd334b226beadc68b11a8f9431852a" +checksum = "ab96b703d31950f1aeddded248bc95543c9efc7ac9c4a21fda8703a83ee35451" dependencies = [ - "dyn-stack 0.10.0", - "gemm-common 0.17.1", + "dyn-stack", + "gemm-c32", + "gemm-c64", + "gemm-common", + "gemm-f16", + "gemm-f32", + "gemm-f64", "num-complex", "num-traits", "paste", - "raw-cpuid 10.7.0", + "raw-cpuid", "seq-macro", ] [[package]] -name = "gemm-c64" +name = "gemm-c32" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfcad8a3d35a43758330b635d02edad980c1e143dc2f21e6fd25f9e4eada8edf" +checksum = "f6db9fd9f40421d00eea9dd0770045a5603b8d684654816637732463f4073847" dependencies = [ - "dyn-stack 0.13.0", - "gemm-common 0.18.2", + "dyn-stack", + "gemm-common", "num-complex", "num-traits", "paste", - "raw-cpuid 11.5.0", + "raw-cpuid", "seq-macro", ] [[package]] -name = "gemm-common" -version = "0.17.1" +name = "gemm-c64" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2e7ea062c987abcd8db95db917b4ffb4ecdfd0668471d8dc54734fdff2354e8" +checksum = "dfcad8a3d35a43758330b635d02edad980c1e143dc2f21e6fd25f9e4eada8edf" dependencies = [ - "bytemuck", - "dyn-stack 0.10.0", - "half", + "dyn-stack", + "gemm-common", "num-complex", "num-traits", - "once_cell", "paste", - "pulp 0.18.22", - "raw-cpuid 10.7.0", - "rayon", + "raw-cpuid", "seq-macro", - "sysctl 0.5.5", ] [[package]] @@ -503,36 +1045,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a352d4a69cbe938b9e2a9cb7a3a63b7e72f9349174a2752a558a8a563510d0f3" dependencies = [ "bytemuck", - "dyn-stack 0.13.0", + "dyn-stack", "half", "libm", "num-complex", "num-traits", "once_cell", "paste", - "pulp 0.21.4", - "raw-cpuid 11.5.0", - "rayon", - "seq-macro", - "sysctl 0.6.0", -] - -[[package]] -name = "gemm-f16" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca4c06b9b11952071d317604acb332e924e817bd891bec8dfb494168c7cedd4" -dependencies = [ - "dyn-stack 0.10.0", - "gemm-common 0.17.1", - "gemm-f32 0.17.1", - "half", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 10.7.0", + "pulp", + "raw-cpuid", "rayon", "seq-macro", + "sysctl", ] [[package]] @@ -541,60 +1065,30 @@ version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cff95ae3259432f3c3410eaa919033cd03791d81cebd18018393dc147952e109" dependencies = [ - "dyn-stack 0.13.0", - "gemm-common 0.18.2", - "gemm-f32 0.18.2", + "dyn-stack", + "gemm-common", + "gemm-f32", "half", "num-complex", "num-traits", "paste", - "raw-cpuid 11.5.0", + "raw-cpuid", "rayon", "seq-macro", ] -[[package]] -name = "gemm-f32" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9a69f51aaefbd9cf12d18faf273d3e982d9d711f60775645ed5c8047b4ae113" -dependencies = [ - "dyn-stack 0.10.0", - "gemm-common 0.17.1", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 10.7.0", - "seq-macro", -] - [[package]] name = "gemm-f32" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc8d3d4385393304f407392f754cd2dc4b315d05063f62cf09f47b58de276864" dependencies = [ - "dyn-stack 0.13.0", - "gemm-common 0.18.2", - "num-complex", - "num-traits", - "paste", - "raw-cpuid 11.5.0", - "seq-macro", -] - -[[package]] -name = "gemm-f64" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa397a48544fadf0b81ec8741e5c0fba0043008113f71f2034def1935645d2b0" -dependencies = [ - "dyn-stack 0.10.0", - "gemm-common 0.17.1", + "dyn-stack", + "gemm-common", "num-complex", "num-traits", "paste", - "raw-cpuid 10.7.0", + "raw-cpuid", "seq-macro", ] @@ -604,12 +1098,12 @@ version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35b2a4f76ce4b8b16eadc11ccf2e083252d8237c1b589558a49b0183545015bd" dependencies = [ - "dyn-stack 0.13.0", - "gemm-common 0.18.2", + "dyn-stack", + "gemm-common", "num-complex", "num-traits", "paste", - "raw-cpuid 11.5.0", + "raw-cpuid", "seq-macro", ] @@ -628,37 +1122,122 @@ dependencies = [ name = "getrandom" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + +[[package]] +name = "glow" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e5ea60d70410161c8bf5da3fdfeaa1c72ed2c15f8bbb9d19fe3a4fad085f08" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" +dependencies = [ + "gl_generator", +] + +[[package]] +name = "gpu-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" +dependencies = [ + "bitflags 2.9.0", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "gpu-allocator" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" +dependencies = [ + "log", + "presser", + "thiserror 1.0.61", + "windows", +] + +[[package]] +name = "gpu-descriptor" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf29e94d6d243368b7a56caa16bc213e4f9f8ed38c4d9557069527b5d5281ca" +dependencies = [ + "bitflags 2.9.0", + "gpu-descriptor-types", + "hashbrown", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasi 0.14.2+wasi-0.2.4", + "bitflags 2.9.0", ] [[package]] name = "half" -version = "2.4.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" dependencies = [ "bytemuck", "cfg-if", "crunchy", "num-traits", - "rand 0.8.5", - "rand_distr 0.4.3", + "rand", + "rand_distr", + "serde", ] [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", "foldhash", + "serde", ] [[package]] @@ -679,6 +1258,18 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "indexmap" version = "2.9.0" @@ -715,6 +1306,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "js-sys" version = "0.3.77" @@ -725,11 +1322,28 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "khronos-egl" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" +dependencies = [ + "libc", + "libloading", + "pkg-config", +] + +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "libc" -version = "0.2.155" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libloading" @@ -753,94 +1367,124 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.9.0", "libc", ] [[package]] -name = "log" -version = "0.4.27" +name = "litrs" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" [[package]] -name = "memchr" -version = "2.7.4" +name = "lock_api" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] [[package]] -name = "memmap2" -version = "0.9.5" +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "malloc_buf" +version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" dependencies = [ "libc", - "stable_deref_trait", ] [[package]] -name = "num" -version = "0.4.3" +name = "md5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] +checksum = "ae960838283323069879657ca3de837e9f7bbb4c7bf6ea7f1b290d5e9476d2e0" [[package]] -name = "num-bigint" -version = "0.4.6" +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "metal" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "f569fb946490b5743ad69813cb19629130ce9374034abe31614a36402d18f99e" dependencies = [ - "num-integer", - "num-traits", + "bitflags 2.9.0", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", ] [[package]] -name = "num-complex" -version = "0.4.6" +name = "naga" +version = "25.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +checksum = "2b977c445f26e49757f9aca3631c3b8b836942cb278d69a92e7b80d3b24da632" dependencies = [ - "bytemuck", + "arrayvec", + "bit-set", + "bitflags 2.9.0", + "cfg_aliases", + "codespan-reporting", + "half", + "hashbrown", + "hexf-parse", + "indexmap", + "log", "num-traits", + "once_cell", + "rustc-hash", + "spirv", + "strum", + "thiserror 2.0.12", + "unicode-ident", ] [[package]] -name = "num-integer" -version = "0.1.46" +name = "nb" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" dependencies = [ - "num-traits", + "nb 1.1.0", ] [[package]] -name = "num-iter" -version = "0.1.45" +name = "nb" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "jni-sys", ] [[package]] -name = "num-rational" -version = "0.4.2" +name = "num-complex" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ - "num-bigint", - "num-integer", + "bytemuck", "num-traits", ] @@ -865,24 +1509,12 @@ dependencies = [ ] [[package]] -name = "num_enum" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.3" +name = "objc" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "malloc_buf", ] [[package]] @@ -903,6 +1535,44 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-float" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" +dependencies = [ + "num-traits", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + [[package]] name = "paste" version = "1.0.15" @@ -927,6 +1597,18 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + [[package]] name = "plotters" version = "0.3.7" @@ -955,6 +1637,15 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "portable-atomic" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +dependencies = [ + "serde", +] + [[package]] name = "ppv-lite86" version = "0.2.21" @@ -965,34 +1656,35 @@ dependencies = [ ] [[package]] -name = "proc-macro-crate" -version = "3.3.0" +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + +[[package]] +name = "prettyplease" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" dependencies = [ - "toml_edit", + "proc-macro2", + "syn", ] [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] -name = "pulp" -version = "0.18.22" +name = "profiling" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a01a0dc67cf4558d279f0c25b0962bd08fc6dec0137699eae304103e882fe6" -dependencies = [ - "bytemuck", - "libm", - "num-complex", - "reborrow", -] +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" [[package]] name = "pulp" @@ -1023,35 +1715,14 @@ version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - [[package]] name = "rand" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", + "rand_chacha", + "rand_core", ] [[package]] @@ -1061,16 +1732,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.15", + "rand_core", ] [[package]] @@ -1082,16 +1744,6 @@ dependencies = [ "getrandom 0.3.2", ] -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - [[package]] name = "rand_distr" version = "0.5.1" @@ -1099,17 +1751,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463" dependencies = [ "num-traits", - "rand 0.9.1", + "rand", ] [[package]] -name = "raw-cpuid" -version = "10.7.0" +name = "range-alloc" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" -dependencies = [ - "bitflags 1.3.2", -] +checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde" [[package]] name = "raw-cpuid" @@ -1117,9 +1766,15 @@ version = "11.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6df7ab838ed27997ba19a4664507e6f82b41fe6e20be42929332156e5e85146" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.9.0", ] +[[package]] +name = "raw-window-handle" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" + [[package]] name = "rayon" version = "1.10.0" @@ -1146,6 +1801,15 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" +[[package]] +name = "redox_syscall" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" +dependencies = [ + "bitflags 2.9.0", +] + [[package]] name = "redox_users" version = "0.4.5" @@ -1154,7 +1818,18 @@ checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom 0.2.15", "libredox", - "thiserror", + "thiserror 1.0.61", +] + +[[package]] +name = "redox_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror 2.0.12", ] [[package]] @@ -1186,6 +1861,18 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +[[package]] +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustversion" version = "1.0.20" @@ -1199,24 +1886,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] -name = "safetensors" -version = "0.4.5" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44560c11236a6130a46ce36c836a62936dc81ebf8c36a37947423571be0e55b6" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "serde", - "serde_json", + "winapi-util", ] [[package]] -name = "same-file" -version = "1.0.6" +name = "sanitize-filename" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "bc984f4f9ceb736a7bb755c3e3bd17dc56370af2600c9780dcc48c66453da34d" dependencies = [ - "winapi-util", + "regex", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "seq-macro" version = "0.3.6" @@ -1229,72 +1921,118 @@ version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ - "serde_derive", + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83" +dependencies = [ + "serde", +] + +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" + +[[package]] +name = "spin" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" +dependencies = [ + "lock_api", + "portable-atomic", ] [[package]] -name = "serde_derive" -version = "1.0.210" +name = "spirv" +version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "proc-macro2", - "quote", - "syn", + "bitflags 2.9.0", ] [[package]] -name = "serde_json" -version = "1.0.140" +name = "static_assertions" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "strsim" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "syn" -version = "2.0.66" +name = "strum" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "strum_macros", ] [[package]] -name = "synstructure" -version = "0.13.1" +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ + "heck", "proc-macro2", "quote", + "rustversion", "syn", ] [[package]] -name = "sysctl" -version = "0.5.5" +name = "syn" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7dddc5f0fee506baf8b9fdb989e242f17e4b11c61dfbb0635b705217199eea" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ - "bitflags 2.5.0", - "byteorder", - "enum-as-inner", - "libc", - "thiserror", - "walkdir", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] @@ -1303,21 +2041,39 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01198a2debb237c62b6826ec7081082d951f46dbb64b0e8c7649a452230d1dfc" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.9.0", "byteorder", "enum-as-inner", "libc", - "thiserror", + "thiserror 1.0.61", "walkdir", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.61", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -1331,6 +2087,17 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -1342,73 +2109,43 @@ dependencies = [ ] [[package]] -name = "toml_datetime" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" - -[[package]] -name = "toml_edit" -version = "0.22.25" +name = "toml" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10558ed0bd2a1562e630926a2d1f0b98c827da99fabd3fe20920a59642504485" +checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8" dependencies = [ "indexmap", + "serde", + "serde_spanned", "toml_datetime", + "toml_parser", + "toml_writer", "winnow", ] [[package]] -name = "tracing" -version = "0.1.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.28" +name = "toml_datetime" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3" dependencies = [ - "proc-macro2", - "quote", - "syn", + "serde", ] [[package]] -name = "tracing-core" -version = "0.1.33" +name = "toml_parser" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10" dependencies = [ - "once_cell", + "winnow", ] [[package]] -name = "ug" -version = "0.1.0" +name = "toml_writer" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03719c61a91b51541f076dfdba45caacf750b230cefaa4b32d6f5411c3f7f437" -dependencies = [ - "gemm 0.18.2", - "half", - "libloading", - "memmap2", - "num", - "num-traits", - "num_cpus", - "rayon", - "safetensors", - "serde", - "thiserror", - "tracing", - "yoke", -] +checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64" [[package]] name = "unicode-ident" @@ -1416,12 +2153,41 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "variadics_please" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41b6d82be61465f97d42bd1d15bf20f3b0a3a0905018f38f9d6f6962055b0b5c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + [[package]] name = "walkdir" version = "2.5.0" @@ -1473,6 +2239,19 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.100" @@ -1515,6 +2294,163 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wgpu" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6049eb2014a0e0d8689f9b787605dd71d5bbfdc74095ead499f3cff705c229" +dependencies = [ + "arrayvec", + "bitflags 2.9.0", + "cfg_aliases", + "document-features", + "hashbrown", + "js-sys", + "log", + "naga", + "parking_lot", + "portable-atomic", + "profiling", + "raw-window-handle", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "25.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19813e647da7aa3cdaa84f5846e2c64114970ea7c86b1e6aae8be08091f4bdc" +dependencies = [ + "arrayvec", + "bit-set", + "bit-vec", + "bitflags 2.9.0", + "cfg_aliases", + "document-features", + "hashbrown", + "indexmap", + "log", + "naga", + "once_cell", + "parking_lot", + "portable-atomic", + "profiling", + "raw-window-handle", + "rustc-hash", + "smallvec", + "thiserror 2.0.12", + "wgpu-core-deps-apple", + "wgpu-core-deps-emscripten", + "wgpu-core-deps-windows-linux-android", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core-deps-apple" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd488b3239b6b7b185c3b045c39ca6bf8af34467a4c5de4e0b1a564135d093d" +dependencies = [ + "wgpu-hal", +] + +[[package]] +name = "wgpu-core-deps-emscripten" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09ad7aceb3818e52539acc679f049d3475775586f3f4e311c30165cf2c00445" +dependencies = [ + "wgpu-hal", +] + +[[package]] +name = "wgpu-core-deps-windows-linux-android" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cba5fb5f7f9c98baa7c889d444f63ace25574833df56f5b817985f641af58e46" +dependencies = [ + "wgpu-hal", +] + +[[package]] +name = "wgpu-hal" +version = "25.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb7c4a1dc42ff14c23c9b11ebf1ee85cde661a9b1cf0392f79c1faca5bc559fb" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set", + "bitflags 2.9.0", + "block", + "bytemuck", + "cfg-if", + "cfg_aliases", + "core-graphics-types", + "glow", + "glutin_wgl_sys", + "gpu-alloc", + "gpu-allocator", + "gpu-descriptor", + "hashbrown", + "js-sys", + "khronos-egl", + "libc", + "libloading", + "log", + "metal", + "naga", + "ndk-sys", + "objc", + "ordered-float", + "parking_lot", + "portable-atomic", + "profiling", + "range-alloc", + "raw-window-handle", + "renderdoc-sys", + "smallvec", + "thiserror 2.0.12", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "windows", + "windows-core", +] + +[[package]] +name = "wgpu-types" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aa49460c2a8ee8edba3fca54325540d904dd85b2e086ada762767e17d06e8bc" +dependencies = [ + "bitflags 2.9.0", + "bytemuck", + "js-sys", + "log", + "thiserror 2.0.12", + "web-sys", +] + [[package]] name = "winapi-util" version = "0.1.9" @@ -1524,6 +2460,70 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -1665,12 +2665,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.7.7" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb8234a863ea0e8cd7284fcdd4f145233eb00fee02bbdd9861aec44e6477bc5" -dependencies = [ - "memchr", -] +checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" [[package]] name = "wit-bindgen-rt" @@ -1678,32 +2675,14 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "yoke" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", + "bitflags 2.9.0", ] [[package]] -name = "yoke-derive" -version = "0.7.5" +name = "xml-rs" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] +checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" [[package]] name = "zerocopy" @@ -1724,39 +2703,3 @@ dependencies = [ "quote", "syn", ] - -[[package]] -name = "zerofrom" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zip" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cc23c04387f4da0374be4533ad1208cbb091d5c11d070dfef13676ad6497164" -dependencies = [ - "arbitrary", - "crc32fast", - "crossbeam-utils", - "displaydoc", - "indexmap", - "num_enum", - "thiserror", -] diff --git a/Cargo.toml b/Cargo.toml index c4078c6..521cff8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,3 +24,4 @@ gemm = "0.18" num_cpus = "1.16.0" rand = "0.9.1" rand_distr = "0.5.1" +cubecl = "0.6.0" diff --git a/README.md b/README.md index 1df586c..faafcc0 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,11 @@ Experimental machine learning framework featuring a graph-based JIT compiler. - Multi-device support (CPU, optional CUDA) - Graph visualization (requires Graphviz) - Zero-cost abstractions with idiomatic Rust API +- Broad GPU support: + - CUDA (NVIDIA): `--features cuda` + - HIP (AMD): `--features hip` + - Metal (Apple): `--features metal` + - WGPU (recommended for [all others](https://github.com/gfx-rs/wgpu?tab=readme-ov-file#supported-platforms)): `--features wgpu` ## Installation diff --git a/constensor-core/Cargo.toml b/constensor-core/Cargo.toml index 122fa0d..0a33b91 100644 --- a/constensor-core/Cargo.toml +++ b/constensor-core/Cargo.toml @@ -20,22 +20,19 @@ gemm.workspace = true num_cpus.workspace = true rand.workspace = true rand_distr.workspace = true +cubecl = { workspace = true, features = ["compilation-cache", "wgpu"] } [features] -default = [] -all = ["cuda", "half", "bfloat"] -cuda = ["cudarc"] +default = ["half", "bfloat"] +cuda = ["cudarc", "cubecl/cuda"] +hip = ["cubecl/hip"] +metal = ["cubecl/wgpu-msl"] half = ["dep:half"] bfloat = ["dep:half"] slow_integral_fma_cuda = [] -[[example]] -name = "hello_world" -required-features = [] - [dev-dependencies] criterion = "0.5" -candle-core = "0.8" [[bench]] name = "cpu_graph" diff --git a/constensor-core/benches/cpu_graph.rs b/constensor-core/benches/cpu_graph.rs index 904e1e3..129b361 100644 --- a/constensor-core/benches/cpu_graph.rs +++ b/constensor-core/benches/cpu_graph.rs @@ -1,4 +1,4 @@ -use candle_core::{Device, Tensor}; +// use candle_core::{Device, Tensor}; use constensor_core::{Cpu, Graph, GraphTensor, R3}; use criterion::{criterion_group, criterion_main, Criterion}; @@ -44,46 +44,46 @@ fn bench_cpu_graph_matmul_256(c: &mut Criterion) { }); } -fn bench_candle_matmul_64(c: &mut Criterion) { - const N: usize = 64; - c.bench_function("candle_matmul_64x64", |bencher| { - bencher.iter(|| { - let a = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); - let b = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); - let _ = a.matmul(&b).unwrap(); - }); - }); -} +// fn bench_candle_matmul_64(c: &mut Criterion) { +// const N: usize = 64; +// let a = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); +// let b = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); +// c.bench_function("candle_matmul_64x64", |bencher| { +// bencher.iter(|| { +// let _ = a.matmul(&b).unwrap(); +// }); +// }); +// } -fn bench_candle_matmul_128(c: &mut Criterion) { - const N: usize = 128; - c.bench_function("candle_matmul_128x128", |bencher| { - bencher.iter(|| { - let a = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); - let b = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); - let _ = a.matmul(&b).unwrap(); - }); - }); -} +// fn bench_candle_matmul_128(c: &mut Criterion) { +// const N: usize = 128; +// let a = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); +// let b = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); +// c.bench_function("candle_matmul_128x128", |bencher| { +// bencher.iter(|| { +// let _ = a.matmul(&b).unwrap(); +// }); +// }); +// } -fn bench_candle_matmul_256(c: &mut Criterion) { - const N: usize = 256; - c.bench_function("candle_matmul_256x256", |bencher| { - bencher.iter(|| { - let a = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); - let b = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); - let _ = a.matmul(&b).unwrap(); - }); - }); -} +// fn bench_candle_matmul_256(c: &mut Criterion) { +// const N: usize = 256; +// let a = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); +// let b = Tensor::rand(0f32, 1f32, &[1, N, N], &Device::Cpu).unwrap(); +// c.bench_function("candle_matmul_256x256", |bencher| { +// bencher.iter(|| { +// let _ = a.matmul(&b).unwrap(); +// }); +// }); +// } criterion_group!( benches, bench_cpu_graph_matmul_64, bench_cpu_graph_matmul_128, bench_cpu_graph_matmul_256, - bench_candle_matmul_64, - bench_candle_matmul_128, - bench_candle_matmul_256 + // bench_candle_matmul_64, + // bench_candle_matmul_128, + // bench_candle_matmul_256 ); criterion_main!(benches); diff --git a/constensor-core/examples/test/main.rs b/constensor-core/examples/test/main.rs new file mode 100644 index 0000000..a49910d --- /dev/null +++ b/constensor-core/examples/test/main.rs @@ -0,0 +1,18 @@ +use constensor_core::{Graph, GraphTensor, Tensor, Wgpu, R2}; + +fn main() { + let mut graph: Graph = Graph::empty(); + let a = GraphTensor::, f32, Wgpu>::fill(&mut graph, 1.0); + let b = GraphTensor::, f32, Wgpu>::fill(&mut graph, 2.0); + let c = GraphTensor::, f32, Wgpu>::fill(&mut graph, 3.0); + let _out = a + b + c; + + graph.visualize("graph.png").unwrap(); + + let compiled: constensor_core::CompiledGraph, f32, Wgpu> = graph.compile().unwrap(); + let res = compiled.run().unwrap(); + + let tensor: Tensor, f32, Wgpu> = res; + + assert_eq!(tensor.data().unwrap().to_vec(), vec![vec![6.0; 4]; 3],); +} diff --git a/constensor-core/src/cpu_storage/mod.rs b/constensor-core/src/backends/cpu_backend/mod.rs similarity index 88% rename from constensor-core/src/cpu_storage/mod.rs rename to constensor-core/src/backends/cpu_backend/mod.rs index 31982ca..803d10a 100644 --- a/constensor-core/src/cpu_storage/mod.rs +++ b/constensor-core/src/backends/cpu_backend/mod.rs @@ -1,5 +1,4 @@ -use petgraph::algo::toposort; -use petgraph::graphmap::DiGraphMap; +use super::scheduler::topo_order; use std::{borrow::Cow, marker::PhantomData}; use pool::{BufferPool, PooledBuffer}; @@ -31,7 +30,7 @@ impl BackendStorage for CpuStorage { Ok(Cow::Borrowed(self)) } fn cast(&self) -> Result> { - let new = self.0.iter().map(|x| U::from_f64(x.to_f64())); + let new = self.0.iter().map(|x| U::from_f64(x.cast_f64())); Ok(Storage::Cpu(CpuStorage(new.collect()))) } } @@ -43,47 +42,8 @@ impl BackendDevice for CpuDevice { &self, graph: Vec>, ) -> Result> { - // Build a dependency graph of tensor indices - let mut dep_graph = DiGraphMap::::new(); - for id in 0..graph.len() { - dep_graph.add_node(id); - } - - for node in graph.iter() { - let idx = node.id.get(); - match &node.op { - Op::BinaryOp { l_id, r_id, .. } => { - dep_graph.add_edge(l_id.get(), idx, ()); - dep_graph.add_edge(r_id.get(), idx, ()); - } - Op::UnaryOp { v_id, .. } => { - dep_graph.add_edge(v_id.get(), idx, ()); - } - Op::FusedMulAdd { a_id, b_id, c_id } => { - dep_graph.add_edge(a_id.get(), idx, ()); - dep_graph.add_edge(b_id.get(), idx, ()); - dep_graph.add_edge(c_id.get(), idx, ()); - } - Op::MatMul { - l_id, r_id, o_id, .. - } => { - dep_graph.add_edge(l_id.get(), idx, ()); - dep_graph.add_edge(r_id.get(), idx, ()); - if let Some(o_id) = o_id { - dep_graph.add_edge(o_id.get(), idx, ()); - } - } - Op::Permute { v_id } => { - dep_graph.add_edge(v_id.get(), idx, ()); - } - // NoOp, Fill/Arange, Rand/Randn don’t create incoming edges - Op::NoOp | Op::Fill { .. } | Op::Arange { .. } | Op::Rand | Op::Randn { .. } => {} - } - } - - // Compute topological order - let order = toposort(&dep_graph, None).expect("Cycle detected in graph!"); - + // Compute topological order using shared scheduler + let order = topo_order(&graph); Ok(CompiledGraph::Cpu { order, graph, @@ -240,10 +200,10 @@ fn eval_node( } Op::Arange { start, step, stop } => { let mut buf = pool.lock().unwrap().get_empty_buffer(out_elem_count); - let mut x = start.to_f64(); - while x < stop.to_f64() { + let mut x = start.cast_f64(); + while x < stop.cast_f64() { buf.push(T::from_f64(x)); - x += step.to_f64(); + x += step.cast_f64(); } PooledBuffer::new(buf, pool.clone()) } @@ -255,8 +215,8 @@ fn eval_node( PooledBuffer::new(buf, pool.clone()) } Op::Randn { mean, std } => { - let mean_f = mean.to_f64(); - let std_f = std.to_f64(); + let mean_f = mean.cast_f64(); + let std_f = std.cast_f64(); let normal = Normal::new(mean_f, std_f).unwrap(); let mut buf = pool.lock().unwrap().get_buffer(out_elem_count); for elt in &mut buf { diff --git a/constensor-core/src/cpu_storage/pool.rs b/constensor-core/src/backends/cpu_backend/pool.rs similarity index 98% rename from constensor-core/src/cpu_storage/pool.rs rename to constensor-core/src/backends/cpu_backend/pool.rs index 84154b2..35ce628 100644 --- a/constensor-core/src/cpu_storage/pool.rs +++ b/constensor-core/src/backends/cpu_backend/pool.rs @@ -128,7 +128,7 @@ impl BufferPool { self.pool .iter() .map(|b| b.capacity() * size_of::()) - .sum() + .sum::() ); buf @@ -161,7 +161,7 @@ impl BufferPool { self.pool .iter() .map(|b| b.capacity() * size_of::()) - .sum() + .sum::() ); self.trim_excess(); @@ -195,7 +195,7 @@ impl BufferPool { self.pool .iter() .map(|b| b.capacity() * size_of::()) - .sum() + .sum::() ); } diff --git a/constensor-core/src/cuda_backend/error.rs b/constensor-core/src/backends/cuda_backend/error.rs similarity index 100% rename from constensor-core/src/cuda_backend/error.rs rename to constensor-core/src/backends/cuda_backend/error.rs diff --git a/constensor-core/src/cuda_backend/mod.rs b/constensor-core/src/backends/cuda_backend/mod.rs similarity index 93% rename from constensor-core/src/cuda_backend/mod.rs rename to constensor-core/src/backends/cuda_backend/mod.rs index 29897f2..5ec5a0f 100644 --- a/constensor-core/src/cuda_backend/mod.rs +++ b/constensor-core/src/backends/cuda_backend/mod.rs @@ -1,3 +1,4 @@ +use super::scheduler::topo_order; use cudarc::{ cublas::CudaBlas, driver::{ @@ -6,7 +7,6 @@ use cudarc::{ nvrtc::{CompileOptions, Ptx}, }; use error::WrapErr; -use petgraph::{algo::toposort, prelude::DiGraphMap}; use std::sync::{ atomic::{AtomicUsize, Ordering}, Arc, Mutex, RwLock, @@ -474,45 +474,8 @@ impl BackendDevice for CudaDevice { &self, graph: Vec>, ) -> Result> { - // Build a dependency graph of tensor indices - let mut dep_graph = DiGraphMap::::new(); - for idx in 0..graph.len() { - dep_graph.add_node(idx); - } - - for (idx, node) in graph.iter().enumerate() { - match &node.op { - Op::BinaryOp { l_id, r_id, .. } => { - dep_graph.add_edge(l_id.get(), idx, ()); - dep_graph.add_edge(r_id.get(), idx, ()); - } - Op::UnaryOp { v_id, .. } => { - dep_graph.add_edge(v_id.get(), idx, ()); - } - Op::FusedMulAdd { a_id, b_id, c_id } => { - dep_graph.add_edge(a_id.get(), idx, ()); - dep_graph.add_edge(b_id.get(), idx, ()); - dep_graph.add_edge(c_id.get(), idx, ()); - } - Op::MatMul { - l_id, r_id, o_id, .. - } => { - dep_graph.add_edge(l_id.get(), idx, ()); - dep_graph.add_edge(r_id.get(), idx, ()); - if let Some(o_id) = o_id { - dep_graph.add_edge(o_id.get(), idx, ()); - } - } - Op::Permute { v_id } => { - dep_graph.add_edge(v_id.get(), idx, ()); - } - // These don’t create incoming edges - Op::NoOp | Op::Fill { .. } | Op::Rand | Op::Randn { .. } | Op::Arange { .. } => {} - } - } - - // Compute topological order - let order = toposort(&dep_graph, None).expect("Cycle detected in graph!"); + // Compute topological order using shared scheduler + let order = topo_order(&graph); // New kernel and grouping logic with matmul input tracking let mut kernels = Vec::>::new(); diff --git a/constensor-core/src/cuda_backend/util.rs b/constensor-core/src/backends/cuda_backend/util.rs similarity index 100% rename from constensor-core/src/cuda_backend/util.rs rename to constensor-core/src/backends/cuda_backend/util.rs diff --git a/constensor-core/src/backends/mod.rs b/constensor-core/src/backends/mod.rs new file mode 100644 index 0000000..784a95a --- /dev/null +++ b/constensor-core/src/backends/mod.rs @@ -0,0 +1,5 @@ +pub mod cpu_backend; +#[cfg(feature = "cuda")] +pub mod cuda_backend; +pub mod scheduler; +pub mod wgpu_backend; diff --git a/constensor-core/src/backends/scheduler.rs b/constensor-core/src/backends/scheduler.rs new file mode 100644 index 0000000..03c5b89 --- /dev/null +++ b/constensor-core/src/backends/scheduler.rs @@ -0,0 +1,50 @@ +use petgraph::algo::toposort; +use petgraph::graphmap::DiGraphMap; + +use crate::{DType, GraphNode, Op}; + +/// Compute a topological ordering of the computation graph nodes. +/// +/// # Panics +/// Panics if the graph contains a cycle. +pub fn topo_order(graph: &[GraphNode]) -> Vec { + // Build dependency graph + let mut dep_graph = DiGraphMap::::new(); + for node in graph.iter() { + let idx = node.id.get(); + dep_graph.add_node(idx); + } + for node in graph.iter() { + let dst = node.id.get(); + match &node.op { + Op::BinaryOp { l_id, r_id, .. } => { + dep_graph.add_edge(l_id.get(), dst, ()); + dep_graph.add_edge(r_id.get(), dst, ()); + } + Op::UnaryOp { v_id, .. } => { + dep_graph.add_edge(v_id.get(), dst, ()); + } + Op::FusedMulAdd { a_id, b_id, c_id } => { + dep_graph.add_edge(a_id.get(), dst, ()); + dep_graph.add_edge(b_id.get(), dst, ()); + dep_graph.add_edge(c_id.get(), dst, ()); + } + Op::MatMul { + l_id, r_id, o_id, .. + } => { + dep_graph.add_edge(l_id.get(), dst, ()); + dep_graph.add_edge(r_id.get(), dst, ()); + if let Some(o) = o_id { + dep_graph.add_edge(o.get(), dst, ()); + } + } + Op::Permute { v_id } => { + dep_graph.add_edge(v_id.get(), dst, ()); + } + // No incoming edges for other ops + _ => {} + } + } + // Compute topological order + toposort(&dep_graph, None).expect("Cycle detected in graph!") +} diff --git a/constensor-core/src/backends/wgpu_backend/kernels.rs b/constensor-core/src/backends/wgpu_backend/kernels.rs new file mode 100644 index 0000000..1c6e1b3 --- /dev/null +++ b/constensor-core/src/backends/wgpu_backend/kernels.rs @@ -0,0 +1,260 @@ +//! Instantiate cubecl kernels for operations on all supported dtypes. + +use crate::{ + dtype::DTypeOps, + graph::{BinaryOpType, UnaryOpType}, +}; +use cubecl::{channel::MutexComputeChannel, cube, prelude::*, wgpu::WgpuServer}; + +use super::RT; + +pub trait UnaryKernelLaunch: CubeType + CubePrimitive + Send + Sync + Cast { + fn launch( + client: &ComputeClient>, + count: CubeCount, + dim: CubeDim, + a: ArrayArg<'_, RT>, + out: ArrayArg<'_, RT>, + numel: u32, + ops: Sequence, + ); +} + +// Integer impl → forwards to unary_int +macro_rules! impl_launch_int { + ($($t:ty),* $(,)?) => { + $( + impl UnaryKernelLaunch for $t { + #[inline(always)] + fn launch( + client: &ComputeClient>, + count: CubeCount, + dim: CubeDim, + a: ArrayArg<'_, RT>, + out: ArrayArg<'_, RT>, + numel: u32, + ops: Sequence, + ) { + unsafe { unary_int::launch_unchecked::(client, count, dim, a, out, numel, ops) }; + } + } + )* + }; +} + +impl_launch_int!(i32, i64, u8, u32); + +impl UnaryKernelLaunch for f32 { + #[inline(always)] + fn launch( + client: &ComputeClient>, + count: CubeCount, + dim: CubeDim, + a: ArrayArg<'_, RT>, + out: ArrayArg<'_, RT>, + numel: u32, + ops: Sequence, + ) { + unsafe { + unary_float::launch_unchecked::(client, count, dim, a, out, numel, ops) + }; + } +} + +impl UnaryKernelLaunch for f64 { + #[inline(always)] + fn launch( + client: &ComputeClient>, + count: CubeCount, + dim: CubeDim, + a: ArrayArg<'_, RT>, + out: ArrayArg<'_, RT>, + numel: u32, + ops: Sequence, + ) { + unsafe { + unary_float::launch_unchecked::(client, count, dim, a, out, numel, ops) + }; + } +} + +#[cfg(feature = "half")] +impl UnaryKernelLaunch for half::f16 { + #[inline(always)] + fn launch( + client: &ComputeClient>, + count: CubeCount, + dim: CubeDim, + a: ArrayArg<'_, RT>, + out: ArrayArg<'_, RT>, + numel: u32, + ops: Sequence, + ) { + unsafe { + unary_float::launch_unchecked::(client, count, dim, a, out, numel, ops) + }; + } +} + +#[cfg(feature = "bfloat")] +impl UnaryKernelLaunch for half::bf16 { + #[inline(always)] + fn launch( + client: &ComputeClient>, + count: CubeCount, + dim: CubeDim, + a: ArrayArg<'_, RT>, + out: ArrayArg<'_, RT>, + numel: u32, + ops: Sequence, + ) { + unsafe { + unary_float::launch_unchecked::(client, count, dim, a, out, numel, ops) + }; + } +} + +/// Convenience wrapper that launches the *right* kernel for `T`. +/// +/// `numel` and `ops` are compile‑time parameters exactly like the inner +/// kernels, so you call this with the same `cube!` launch macro you +/// already use. +/// +/// ```ignore +/// cube!( +/// ctx, +/// unary_auto::( &a, &mut out, comptime numel, comptime ops_seq ) +/// ); +/// ``` +pub(super) fn unary_auto( + client: &ComputeClient>, + count: CubeCount, + dim: CubeDim, + a: ArrayArg<'_, RT>, + out: ArrayArg<'_, RT>, + numel: u32, + ops: Sequence, +) { + T::launch(client, count, dim, a, out, numel, ops); +} + +#[cube(launch_unchecked)] +pub(super) fn binary( + a: &Array>, + b: &Sequence>>, + out: &mut Array>, + #[comptime] numel: u32, + #[comptime] ops: Sequence, +) { + if ABSOLUTE_POS < numel { + let op = comptime! { ops.index(0) }; + let bv = b.index(0); + match op { + BinaryOpType::Add => out[ABSOLUTE_POS] = a[ABSOLUTE_POS] + bv[ABSOLUTE_POS], + BinaryOpType::Sub => out[ABSOLUTE_POS] = a[ABSOLUTE_POS] - bv[ABSOLUTE_POS], + BinaryOpType::Mul => out[ABSOLUTE_POS] = a[ABSOLUTE_POS] * bv[ABSOLUTE_POS], + BinaryOpType::Div => out[ABSOLUTE_POS] = a[ABSOLUTE_POS] / bv[ABSOLUTE_POS], + } + + #[unroll] + for index in 1..ops.len() { + let op = comptime! { ops.index(index.clone()) }; + let bv = b.index(index); + match op { + BinaryOpType::Add => out[ABSOLUTE_POS] = out[ABSOLUTE_POS] + bv[ABSOLUTE_POS], + BinaryOpType::Sub => out[ABSOLUTE_POS] = out[ABSOLUTE_POS] - bv[ABSOLUTE_POS], + BinaryOpType::Mul => out[ABSOLUTE_POS] = out[ABSOLUTE_POS] * bv[ABSOLUTE_POS], + BinaryOpType::Div => out[ABSOLUTE_POS] = out[ABSOLUTE_POS] / bv[ABSOLUTE_POS], + } + } + } +} + +#[cube(launch_unchecked)] +pub(super) fn unary_float( + a: &Array, + out: &mut Array, + #[comptime] numel: u32, + #[comptime] ops: Sequence, +) { + if ABSOLUTE_POS < numel { + let op = comptime! { ops.index(0) }; + match op { + UnaryOpType::Neg => out[ABSOLUTE_POS] = F::from_int(0) - a[ABSOLUTE_POS], + UnaryOpType::Sqrt => out[ABSOLUTE_POS] = F::sqrt(a[ABSOLUTE_POS]), + UnaryOpType::Exp => out[ABSOLUTE_POS] = F::exp(a[ABSOLUTE_POS]), + UnaryOpType::Exp2 => out[ABSOLUTE_POS] = F::powf(F::from_int(2), a[ABSOLUTE_POS]), + UnaryOpType::Log => out[ABSOLUTE_POS] = F::log(a[ABSOLUTE_POS]), + UnaryOpType::Log1p => out[ABSOLUTE_POS] = F::log1p(a[ABSOLUTE_POS]), + } + + #[unroll] + for index in 1..ops.len() { + let op = comptime! { ops.index(index.clone()) }; + match op { + UnaryOpType::Neg => out[ABSOLUTE_POS] = F::from_int(0) - out[ABSOLUTE_POS], + UnaryOpType::Sqrt => out[ABSOLUTE_POS] = F::sqrt(out[ABSOLUTE_POS]), + UnaryOpType::Exp => out[ABSOLUTE_POS] = F::exp(out[ABSOLUTE_POS]), + UnaryOpType::Exp2 => out[ABSOLUTE_POS] = F::powf(F::from_int(2), out[ABSOLUTE_POS]), + UnaryOpType::Log => out[ABSOLUTE_POS] = F::log(out[ABSOLUTE_POS]), + UnaryOpType::Log1p => out[ABSOLUTE_POS] = F::log1p(out[ABSOLUTE_POS]), + } + } + } +} + +#[cube(launch_unchecked)] +pub(super) fn unary_int( + a: &Array, + out: &mut Array, + #[comptime] numel: u32, + #[comptime] ops: Sequence, +) { + if ABSOLUTE_POS < numel { + // ---- first op ----------------------------------------------------- + let op = comptime! { ops.index(0) }; + let mut tmp: f32 = f32::cast_from(a[ABSOLUTE_POS]); + + match op { + UnaryOpType::Neg => tmp = 0. - tmp, + UnaryOpType::Sqrt => tmp = f32::sqrt(tmp), + UnaryOpType::Exp => tmp = f32::exp(tmp), + UnaryOpType::Exp2 => tmp = Powf::powf(2.0_f32, tmp), + UnaryOpType::Log => tmp = Log::log(tmp), + UnaryOpType::Log1p => tmp = Log1p::log1p(tmp), + } + + out[ABSOLUTE_POS] = I::cast_from(tmp); + + // ---- remaining ops (if any) -------------------------------------- + #[unroll] + for index in 1..ops.len() { + let op = comptime! { ops.index(index.clone()) }; + let mut tmp: f32 = f32::cast_from(out[ABSOLUTE_POS]); + + match op { + UnaryOpType::Neg => tmp = 0. - tmp, + UnaryOpType::Sqrt => tmp = f32::sqrt(tmp), + UnaryOpType::Exp => tmp = f32::exp(tmp), + UnaryOpType::Exp2 => tmp = Powf::powf(2.0_f32, tmp), + UnaryOpType::Log => tmp = Log::log(tmp), + UnaryOpType::Log1p => tmp = Log1p::log1p(tmp), + } + + out[ABSOLUTE_POS] = I::cast_from(tmp); + } + } +} + +#[cube(launch_unchecked)] +pub(super) fn fill< + T: CubeType + CubePrimitive + Send + Sync + LaunchArgExpand + Numeric + DTypeOps, +>( + out: &mut Array, + value: T, + #[comptime] numel: u32, +) { + if ABSOLUTE_POS < numel { + out[ABSOLUTE_POS] = value; + } +} diff --git a/constensor-core/src/backends/wgpu_backend/mod.rs b/constensor-core/src/backends/wgpu_backend/mod.rs new file mode 100644 index 0000000..d5020fd --- /dev/null +++ b/constensor-core/src/backends/wgpu_backend/mod.rs @@ -0,0 +1,212 @@ +use std::{borrow::Cow, collections::HashMap, marker::PhantomData}; + +use super::scheduler::topo_order; +use crate::Op; +use cubecl::{ + channel::MutexComputeChannel, + prelude::*, + server::Handle, + wgpu::{WgpuRuntime, WgpuServer}, +}; + +use crate::{ + device::Dev, + storage::{BackendDevice, BackendStorage, Storage}, + CompiledGraph, DType, GraphNode, Result, Shape, +}; + +pub(crate) mod kernels; + +use super::cpu_backend::CpuStorage; + +type RT = WgpuRuntime; + +#[cfg(any(feature = "cuda", feature = "hip"))] +const DEVICE: cubecl::wgpu::WgpuDevice = cubecl::wgpu::WgpuDevice::DiscreteGpu(0); +#[cfg(feature = "metal")] +const DEVICE: cubecl::wgpu::WgpuDevice = cubecl::wgpu::WgpuDevice::IntegratedGpu(0); +#[cfg(not(any(feature = "cuda", feature = "hip", feature = "metal")))] +const DEVICE: cubecl::wgpu::WgpuDevice = cubecl::wgpu::WgpuDevice::DefaultDevice; + +fn client() -> ComputeClient> { + RT::client(&DEVICE) +} + +const VECTORIZATION: u32 = 4; + +pub struct WgpuDevice; + +pub struct WgpuStorage { + handle: Handle, + ghost: PhantomData, +} + +impl BackendStorage for WgpuStorage { + fn to_cpu_storage(&self) -> Result>> { + let client = client(); + + let bytes = client.read_one(self.handle.clone().binding()); + let output = X::from_bytes(&bytes); + + Ok(Cow::Owned(CpuStorage(output.to_vec()))) + } + + fn cast(&self) -> Result> { + todo!() + } +} + +impl BackendDevice for WgpuDevice { + type Storage = WgpuStorage; + + fn compile( + &self, + graph: Vec>, + ) -> Result> { + // Compute topological order using shared scheduler + let order = topo_order(&graph); + Ok(CompiledGraph::Wgpu { + order, + graph, + ghost: PhantomData, + }) + } + + fn run_graph( + &self, + comp: &CompiledGraph, + ) -> Result> { + // Sequential execution of nodes in topological order. + #[allow(irrefutable_let_patterns)] + let CompiledGraph::Wgpu { + order, + graph, + ghost: _, + } = comp + else { + unreachable!("Expected Wgpu compiled graph"); + }; + + let client = client(); + + let mut handles = HashMap::new(); + for &idx in order.iter() { + let node = &graph[idx]; + let out_elem_count: usize = node.shape.iter().product(); + + match &node.op { + Op::Fill { v } => { + let output_handle = client.empty(out_elem_count * core::mem::size_of::()); + + let out: ArrayArg<'_, RT> = unsafe { + ArrayArg::from_raw_parts::( + &output_handle, + out_elem_count, + VECTORIZATION as u8, + ) + }; + unsafe { + kernels::fill::launch_unchecked::( + &client, + CubeCount::Static(VECTORIZATION, 1, 1), + CubeDim::new((out_elem_count as u32).div_ceil(VECTORIZATION), 1, 1), + out, + ScalarArg::new(*v), + out_elem_count as u32, + ); + }; + + handles.insert(idx, output_handle.clone()); + } + + Op::BinaryOp { + l_id, + r_id, + operator, + } => { + let a_handle = &handles[&l_id.get()]; + let b_handle = &handles[&r_id.get()]; + let output_handle = client.empty(out_elem_count * core::mem::size_of::()); + + unsafe { + let a: ArrayArg<'_, RT> = ArrayArg::from_raw_parts::( + &a_handle, + out_elem_count, + VECTORIZATION as u8, + ); + + let mut b_seq: SequenceArg<'_, RT, Array>> = SequenceArg::new(); + b_seq.push(ArrayArg::from_raw_parts::( + &b_handle, + out_elem_count, + VECTORIZATION as u8, + )); + + let out: ArrayArg<'_, RT> = ArrayArg::from_raw_parts::( + &output_handle, + out_elem_count, + VECTORIZATION as u8, + ); + + let mut ops = Sequence::new(); + ops.push(*operator); + kernels::binary::launch_unchecked( + &client, + CubeCount::Static(VECTORIZATION, 1, 1), + CubeDim::new((out_elem_count as u32).div_ceil(VECTORIZATION), 1, 1), + a, + b_seq, + out, + out_elem_count as u32, + ops, + ); + }; + + handles.insert(idx, output_handle.clone()); + } + + Op::UnaryOp { v_id, operator } => { + let v_handle = &handles[&v_id.get()]; + let output_handle = client.empty(out_elem_count * core::mem::size_of::()); + + unsafe { + let a: ArrayArg<'_, RT> = ArrayArg::from_raw_parts::( + &v_handle, + out_elem_count, + VECTORIZATION as u8, + ); + + let out: ArrayArg<'_, RT> = ArrayArg::from_raw_parts::( + &output_handle, + out_elem_count, + VECTORIZATION as u8, + ); + + let mut ops = Sequence::new(); + ops.push(*operator); + kernels::unary_auto::( + &client, + CubeCount::Static(VECTORIZATION, 1, 1), + CubeDim::new((out_elem_count as u32).div_ceil(VECTORIZATION), 1, 1), + a, + out, + out_elem_count as u32, + ops, + ); + }; + + handles.insert(idx, output_handle.clone()); + } + + _ => todo!(), + } + } + + let key = *handles.keys().max().unwrap(); + let final_handle = handles.remove(&key).expect("No output"); + Ok(WgpuStorage { + handle: final_handle, + ghost: PhantomData, + }) + } +} diff --git a/constensor-core/src/device.rs b/constensor-core/src/device.rs index fe03c45..d18011c 100644 --- a/constensor-core/src/device.rs +++ b/constensor-core/src/device.rs @@ -1,7 +1,8 @@ #[cfg(feature = "cuda")] use crate::cuda_backend::CudaDevice; use crate::{ - cpu_storage::CpuDevice, + backends::wgpu_backend::WgpuDevice, + cpu_backend::CpuDevice, storage::{BackendDevice, Storage}, CompiledGraph, DType, GraphNode, Result, Shape, }; @@ -19,6 +20,14 @@ impl Dev for Cpu { Ok(Device::Cpu) } } +#[derive(Clone)] +pub struct Wgpu; + +impl Dev for Wgpu { + fn resolve() -> Result { + Ok(Device::Wgpu) + } +} #[cfg(feature = "cuda")] #[derive(Clone)] @@ -68,6 +77,7 @@ pub enum Device { #[cfg(feature = "cuda")] Cuda(CudaDevice), Cpu, + Wgpu, } impl Device { @@ -79,6 +89,7 @@ impl Device { #[cfg(feature = "cuda")] Self::Cuda(cuda) => Ok(Storage::Cuda(cuda.run_graph::(graph)?)), Self::Cpu => Ok(Storage::Cpu(CpuDevice.run_graph::(graph)?)), + Self::Wgpu => Ok(Storage::Wgpu(WgpuDevice.run_graph::(graph)?)), } } @@ -90,6 +101,7 @@ impl Device { #[cfg(feature = "cuda")] Self::Cuda(cuda) => cuda.compile::(graph), Self::Cpu => CpuDevice.compile::(graph), + Self::Wgpu => WgpuDevice.compile::(graph), } } } diff --git a/constensor-core/src/dtype/mod.rs b/constensor-core/src/dtype/mod.rs index 3529fc2..36b3f88 100644 --- a/constensor-core/src/dtype/mod.rs +++ b/constensor-core/src/dtype/mod.rs @@ -3,6 +3,10 @@ use std::{ ops::{Add, Div, Mul, Sub}, }; +use cubecl::{ + prelude::{CubePrimitive, CubeType, Numeric}, + CubeElement, +}; #[cfg(feature = "bfloat")] use half::bf16; #[cfg(feature = "half")] @@ -273,34 +277,6 @@ impl Loggable for f16 { } } -pub trait DTypeOps: - Copy - + Add - + Div - + Sub - + Mul - + Sqrtable - + Expable - + Loggable - + SimdSupported - + GemmDispatch - + RandDispatch -{ -} - -#[cfg(feature = "cuda")] -pub trait DeviceReprLike: DeviceRepr {} - -#[cfg(not(feature = "cuda"))] -pub trait DeviceReprLike {} - -impl DeviceReprLike for u8 {} -impl DeviceReprLike for i32 {} -impl DeviceReprLike for u32 {} -impl DeviceReprLike for i64 {} -impl DeviceReprLike for f32 {} -impl DeviceReprLike for f64 {} - pub trait MaybeNeg { const NAME: &'static str; @@ -339,9 +315,49 @@ maybe_neg!(i64); maybe_neg!(f32); maybe_neg!(f64); +pub trait DTypeOps: + Copy + + Add + + Div + + Sub + + Mul + + MaybeNeg + + Sqrtable + + Expable + + Loggable + + SimdSupported + + GemmDispatch + + RandDispatch + + CubeType + + crate::wgpu_backend::kernels::UnaryKernelLaunch +{ +} + +#[cfg(feature = "cuda")] +pub trait DeviceReprLike: DeviceRepr {} + +#[cfg(not(feature = "cuda"))] +pub trait DeviceReprLike {} + +impl DeviceReprLike for u8 {} +impl DeviceReprLike for i32 {} +impl DeviceReprLike for u32 {} +impl DeviceReprLike for i64 {} +impl DeviceReprLike for f32 {} +impl DeviceReprLike for f64 {} + /// Marker trait for tensor datatypes. pub trait DType: - Debug + Clone + DTypeOps + Send + Sync + MaybeNeg + DeviceReprLike + 'static + Debug + + Clone + + DTypeOps + + Send + + Sync + + DeviceReprLike + + CubePrimitive + + CubeElement + + Numeric + + 'static { const ZERO: Self; const ONE: Self; @@ -349,7 +365,7 @@ pub trait DType: const C_DEP: Option<&'static str>; const INTEGRAL: bool; - fn to_f64(&self) -> f64; + fn cast_f64(&self) -> f64; fn from_f64(x: f64) -> Self; } @@ -363,7 +379,7 @@ macro_rules! dtype { const C_DEP: Option<&'static str> = None; const INTEGRAL: bool = $integral; - fn to_f64(&self) -> f64 { + fn cast_f64(&self) -> f64 { *self as f64 } fn from_f64(x: f64) -> Self { @@ -394,7 +410,7 @@ impl DType for f16 { const C_DEP: Option<&'static str> = Some("#include \"cuda_fp16.h\""); const INTEGRAL: bool = false; - fn to_f64(&self) -> f64 { + fn cast_f64(&self) -> f64 { self.to_f64_const() } fn from_f64(x: f64) -> Self { @@ -415,7 +431,7 @@ impl DType for bf16 { const C_DEP: Option<&'static str> = Some("#include \"cuda_bf16.h\""); const INTEGRAL: bool = false; - fn to_f64(&self) -> f64 { + fn cast_f64(&self) -> f64 { self.to_f64_const() } fn from_f64(x: f64) -> Self { diff --git a/constensor-core/src/graph.rs b/constensor-core/src/graph.rs index efb2773..fc2a9f8 100644 --- a/constensor-core/src/graph.rs +++ b/constensor-core/src/graph.rs @@ -13,6 +13,7 @@ use std::{ use crate::{device::Dev, tensor::concretetensor::from_storage, DType, Result, Shape, Tensor}; +use cubecl::CubeType; use petgraph::Graph as PetGraph; use petgraph::{dot::Dot, graph::NodeIndex}; @@ -663,6 +664,12 @@ pub enum CompiledGraph { graph: Vec>, ghost: PhantomData<(S, T, D)>, }, + /// Compiled graph for WGPU backend. + Wgpu { + order: Vec, + graph: Vec>, + ghost: PhantomData<(S, T, D)>, + }, #[cfg(feature = "cuda")] Cuda { kernels: Vec>, @@ -679,7 +686,7 @@ impl CompiledGraph { } } -#[derive(PartialEq, Debug, Clone, Copy)] +#[derive(CubeType, Clone, Copy, Debug, Hash, PartialEq, Eq)] pub enum BinaryOpType { Add, Div, @@ -707,7 +714,7 @@ impl BinaryOpType { } } -#[derive(PartialEq, Debug, Clone)] +#[derive(CubeType, Clone, Copy, Debug, Hash, PartialEq, Eq)] pub enum UnaryOpType { Neg, Sqrt, diff --git a/constensor-core/src/lib.rs b/constensor-core/src/lib.rs index 0733715..cff8235 100644 --- a/constensor-core/src/lib.rs +++ b/constensor-core/src/lib.rs @@ -43,9 +43,8 @@ //! assert_eq!(tensor.data().unwrap().to_vec(), vec![vec![9.0; 4]; 3],); //! ``` -mod cpu_storage; -#[cfg(feature = "cuda")] -mod cuda_backend; +mod backends; +use backends::*; mod device; mod dtype; mod error; @@ -56,7 +55,7 @@ mod tensor; #[cfg(feature = "cuda")] pub use device::Cuda; -pub use device::{BestDevice, Cpu}; +pub use device::{BestDevice, Cpu, Wgpu}; pub use dtype::DType; pub use error::{Context, Error, Result}; pub use graph::{CompiledGraph, Graph, GraphNode, Op}; diff --git a/constensor-core/src/storage.rs b/constensor-core/src/storage.rs index a3e0851..d772ae5 100644 --- a/constensor-core/src/storage.rs +++ b/constensor-core/src/storage.rs @@ -2,18 +2,23 @@ use std::borrow::Cow; #[cfg(feature = "cuda")] use crate::cuda_backend::CudaStorage; -use crate::{cpu_storage::CpuStorage, device::Dev, CompiledGraph, DType, GraphNode, Result, Shape}; +use crate::{ + backends::wgpu_backend::WgpuStorage, cpu_backend::CpuStorage, device::Dev, CompiledGraph, + DType, GraphNode, Result, Shape, +}; pub enum Storage { #[cfg(feature = "cuda")] Cuda(CudaStorage), Cpu(CpuStorage), + Wgpu(WgpuStorage), } impl Storage { pub(crate) fn to_cpu_storage(&self) -> Result>> { match self { Self::Cpu(cpu) => cpu.to_cpu_storage(), + Self::Wgpu(wgpu) => wgpu.to_cpu_storage(), #[cfg(feature = "cuda")] Self::Cuda(cuda) => cuda.to_cpu_storage(), } @@ -22,6 +27,7 @@ impl Storage { pub(crate) fn cast(&self) -> Result> { match self { Self::Cpu(cpu) => cpu.cast::(), + Self::Wgpu(wgpu) => wgpu.cast::(), #[cfg(feature = "cuda")] Self::Cuda(cuda) => cuda.cast::(), } diff --git a/constensor-core/src/tensor/concretetensor.rs b/constensor-core/src/tensor/concretetensor.rs index c27f557..63842dd 100644 --- a/constensor-core/src/tensor/concretetensor.rs +++ b/constensor-core/src/tensor/concretetensor.rs @@ -1,5 +1,5 @@ use crate::{ - device::{Cpu, Dev}, + device::{Cpu, Dev, Wgpu}, storage::Storage, DType, Result, Shape, R1, R2, R3, }; @@ -108,6 +108,7 @@ macro_rules! tensor_api { } tensor_api!(Cpu); +tensor_api!(Wgpu); #[cfg(feature = "cuda")] tensor_api!(Cuda<0>); diff --git a/constensor-core/src/tensor/graphtensor.rs b/constensor-core/src/tensor/graphtensor.rs index cf6a9d9..3faeed9 100644 --- a/constensor-core/src/tensor/graphtensor.rs +++ b/constensor-core/src/tensor/graphtensor.rs @@ -257,7 +257,7 @@ impl GraphTensor, T, D> { /// A GraphTensor representing a vector ranging from `start` to `stop` with `step` computed using A. pub fn arange(graph: &mut Graph, start: T, stop: T) -> Self { let id = graph.next_id(); - let step = (stop.to_f64() - start.to_f64()) / (A as f64); + let step = (stop.cast_f64() - start.cast_f64()) / (A as f64); let strides = contiguous_strides(&[A]); graph.add_op::>( Op::Arange { diff --git a/graph.png b/graph.png index 584fddd..90ad13d 100644 Binary files a/graph.png and b/graph.png differ