torobi 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +71 -0
- data/Cargo.lock +539 -0
- data/Cargo.toml +6 -0
- data/LICENSE +21 -0
- data/README.md +259 -0
- data/config/ops.yml +230 -0
- data/docs/plan.md +3982 -0
- data/docs/vendoring.md +656 -0
- data/engine/Cargo.toml +35 -0
- data/engine/build.rs +253 -0
- data/engine/src/checkpoint.rs +513 -0
- data/engine/src/executor.rs +257 -0
- data/engine/src/export.rs +431 -0
- data/engine/src/fixtures.rs +518 -0
- data/engine/src/graph.rs +115 -0
- data/engine/src/init.rs +65 -0
- data/engine/src/interp.rs +985 -0
- data/engine/src/lib.rs +62 -0
- data/engine/src/main.rs +97 -0
- data/engine/src/memory.rs +109 -0
- data/engine/src/mlxc/array.rs +454 -0
- data/engine/src/mlxc/error.rs +205 -0
- data/engine/src/mlxc/fast.rs +46 -0
- data/engine/src/mlxc/handle.rs +155 -0
- data/engine/src/mlxc/io.rs +268 -0
- data/engine/src/mlxc/memory.rs +56 -0
- data/engine/src/mlxc/metal.rs +24 -0
- data/engine/src/mlxc/mod.rs +55 -0
- data/engine/src/mlxc/nn.rs +38 -0
- data/engine/src/mlxc/ops.rs +477 -0
- data/engine/src/mlxc/quantized.rs +405 -0
- data/engine/src/mlxc/random.rs +161 -0
- data/engine/src/mlxc/transforms.rs +439 -0
- data/engine/src/op.rs +745 -0
- data/engine/src/optimizer.rs +650 -0
- data/engine/src/plan.rs +1638 -0
- data/engine/src/runtime.rs +377 -0
- data/engine/src/session.rs +1523 -0
- data/engine/src/state.rs +1007 -0
- data/engine/src/tensor.rs +331 -0
- data/ext/torobi/Cargo.toml +21 -0
- data/ext/torobi/extconf.rb +42 -0
- data/ext/torobi/src/gvl.rs +182 -0
- data/ext/torobi/src/lib.rs +1037 -0
- data/lib/torobi/adapter_file.rb +184 -0
- data/lib/torobi/batch.rb +55 -0
- data/lib/torobi/checkpoint.rb +60 -0
- data/lib/torobi/dsl/builder.rb +414 -0
- data/lib/torobi/dsl/handle.rb +156 -0
- data/lib/torobi/dsl/layers.rb +82 -0
- data/lib/torobi/dsl.rb +35 -0
- data/lib/torobi/errors.rb +88 -0
- data/lib/torobi/export.rb +534 -0
- data/lib/torobi/freeze.rb +24 -0
- data/lib/torobi/freshness.rb +57 -0
- data/lib/torobi/grad_cache.rb +143 -0
- data/lib/torobi/graph_config.rb +301 -0
- data/lib/torobi/hooks.rb +439 -0
- data/lib/torobi/ir/dimensions.rb +26 -0
- data/lib/torobi/ir/dtype.rb +28 -0
- data/lib/torobi/ir/graph/check.rb +116 -0
- data/lib/torobi/ir/graph.rb +52 -0
- data/lib/torobi/ir/input_spec.rb +39 -0
- data/lib/torobi/ir/json.rb +45 -0
- data/lib/torobi/ir/node_spec.rb +52 -0
- data/lib/torobi/ir/parameter_spec.rb +67 -0
- data/lib/torobi/ir/ref.rb +52 -0
- data/lib/torobi/ir/source.rb +65 -0
- data/lib/torobi/ir.rb +23 -0
- data/lib/torobi/journal.rb +310 -0
- data/lib/torobi/lora.rb +190 -0
- data/lib/torobi/memory.rb +50 -0
- data/lib/torobi/metallib.rb +50 -0
- data/lib/torobi/mlx_prebuilt.json +24 -0
- data/lib/torobi/mlx_prebuilt.rb +378 -0
- data/lib/torobi/models/build.rb +37 -0
- data/lib/torobi/models/description.rb +59 -0
- data/lib/torobi/models/gemma3.rb +273 -0
- data/lib/torobi/models/llama.rb +381 -0
- data/lib/torobi/models/modern_bert.rb +513 -0
- data/lib/torobi/models/padding.rb +27 -0
- data/lib/torobi/models/windows.rb +53 -0
- data/lib/torobi/ops.rb +81 -0
- data/lib/torobi/preflight.rb +136 -0
- data/lib/torobi/provenance.rb +75 -0
- data/lib/torobi/quantization.rb +151 -0
- data/lib/torobi/replay.rb +229 -0
- data/lib/torobi/runner.rb +419 -0
- data/lib/torobi/session.rb +855 -0
- data/lib/torobi/shape.rb +438 -0
- data/lib/torobi/tensor_data.rb +178 -0
- data/lib/torobi/version.rb +5 -0
- data/lib/torobi/weights.rb +108 -0
- data/lib/torobi.rb +67 -0
- data/licenses/MLX.txt +21 -0
- data/licenses/README.md +16 -0
- data/licenses/gguflib.txt +21 -0
- data/licenses/mlx-c.txt +21 -0
- data/licenses/mlx-rs.txt +27 -0
- metadata +229 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Torobi
|
|
6
|
+
# Where a session's parameters come from.
|
|
7
|
+
#
|
|
8
|
+
# Three answers, and exactly one of them per session: values written
|
|
9
|
+
# out, one file holding every model's parameters under their qualified
|
|
10
|
+
# paths, or a published file per model. Which it is decides how the
|
|
11
|
+
# engine is opened, so the choosing happens once, here, rather than as
|
|
12
|
+
# a branch inside `Session.open` next to everything else that opening a
|
|
13
|
+
# session involves.
|
|
14
|
+
#
|
|
15
|
+
# The engine has the same three (`plan.rs`), which is why they are three
|
|
16
|
+
# rather than one with options: they are read differently, not
|
|
17
|
+
# configured differently.
|
|
18
|
+
class Weights
|
|
19
|
+
# Says which way, or refuses. `fresh` names the parameters meant to
|
|
20
|
+
# be in no file, which only a published model can be missing.
|
|
21
|
+
#
|
|
22
|
+
# A `pretrained:` path is the model's `model.safetensors`, or the
|
|
23
|
+
# `model.safetensors.index.json` of one published in shards, or the
|
|
24
|
+
# directory holding either: a 7B model comes as four files and an
|
|
25
|
+
# index, and the engine reads them as one.
|
|
26
|
+
def self.of(weights: nil, weights_file: nil, pretrained: nil, fresh: [])
|
|
27
|
+
fresh = Array(fresh).map(&:to_s)
|
|
28
|
+
if !fresh.empty? && pretrained.nil?
|
|
29
|
+
raise ArgumentError, "fresh: names what no file holds, so it goes with pretrained:"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
given = { weights:, weights_file:, pretrained: }.compact
|
|
33
|
+
unless given.size == 1
|
|
34
|
+
raise ArgumentError,
|
|
35
|
+
"a session needs its parameters, from exactly one place: " \
|
|
36
|
+
"weights: {params: {path => {shape:, data:}}}, " \
|
|
37
|
+
"weights_file: a safetensors path, or " \
|
|
38
|
+
"pretrained: {model => path}" \
|
|
39
|
+
"#{" (given #{given.keys.join(", ")})" unless given.empty?}"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
kind, source = given.first
|
|
43
|
+
new(kind:, source:, fresh:)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def initialize(kind:, source:, fresh: [])
|
|
47
|
+
@kind = kind
|
|
48
|
+
@source = source
|
|
49
|
+
@fresh = fresh
|
|
50
|
+
freeze
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Which of the three this is: :weights, :weights_file or :pretrained.
|
|
54
|
+
attr_reader :kind
|
|
55
|
+
|
|
56
|
+
# A packed quantized weight (u32) comes from a file and from nowhere
|
|
57
|
+
# else: there is no initializer that draws a 4-bit integer and the
|
|
58
|
+
# scale that reads it. `fresh:` naming one is refused here, where it
|
|
59
|
+
# is said, rather than as zeros that quietly stand for a model.
|
|
60
|
+
def check_fresh!(config)
|
|
61
|
+
packed = config.parameters.select do |parameter|
|
|
62
|
+
parameter.spec.dtype == :u32 && @fresh.any? do |pattern|
|
|
63
|
+
Weights.matches?(pattern, parameter.qualified_path)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
return self if packed.empty?
|
|
67
|
+
|
|
68
|
+
raise ConfigError,
|
|
69
|
+
"fresh: names #{packed.first.qualified_path.inspect}, which is a packed quantized " \
|
|
70
|
+
"weight (u32) and cannot be initialized. Give a quantized file, or declare the " \
|
|
71
|
+
"model in bf16 and let it be quantized when it is read."
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# The engine's pattern language (`plan.rs` `Pattern`): a path, or a
|
|
75
|
+
# prefix ending in `*`.
|
|
76
|
+
def self.matches?(pattern, path)
|
|
77
|
+
pattern.end_with?("*") ? path.start_with?(pattern.delete_suffix("*")) : path == pattern
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Opens the engine the way this source is read.
|
|
81
|
+
def open(config, optimizer, seed)
|
|
82
|
+
rule = JSON.generate(optimizer)
|
|
83
|
+
case @kind
|
|
84
|
+
when :weights_file
|
|
85
|
+
Native::Session.open_from_file(config.canonical_json, @source.to_s, rule, seed)
|
|
86
|
+
when :pretrained
|
|
87
|
+
Native::Session.open_pretrained(config.canonical_json, JSON.generate(files),
|
|
88
|
+
JSON.generate(@fresh), rule, seed)
|
|
89
|
+
else
|
|
90
|
+
Native::Session.open(config.canonical_json, JSON.generate(inline), rule, seed)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
private
|
|
95
|
+
|
|
96
|
+
def files = @source.to_h { |model, path| [model.to_s, path.to_s] }
|
|
97
|
+
|
|
98
|
+
# Inline weights as JSON: a TensorData spells its numbers out here.
|
|
99
|
+
#
|
|
100
|
+
# That is what this path is, and part of why it is the small one. A
|
|
101
|
+
# parameter worth keeping as bytes arrives as a file, which never
|
|
102
|
+
# becomes numbers in Ruby at all.
|
|
103
|
+
def inline
|
|
104
|
+
params = @source.fetch(:params) { @source.fetch("params") }
|
|
105
|
+
{ params: params.to_h { |path, t| [path, t.is_a?(TensorData) ? t.to_h : t] } }
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
data/lib/torobi.rb
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "torobi/version"
|
|
4
|
+
require_relative "torobi/errors"
|
|
5
|
+
require_relative "torobi/freeze"
|
|
6
|
+
require_relative "torobi/ir"
|
|
7
|
+
require_relative "torobi/graph_config"
|
|
8
|
+
require_relative "torobi/provenance"
|
|
9
|
+
require_relative "torobi/journal"
|
|
10
|
+
require_relative "torobi/ops"
|
|
11
|
+
require_relative "torobi/shape"
|
|
12
|
+
require_relative "torobi/dsl"
|
|
13
|
+
require_relative "torobi/lora"
|
|
14
|
+
require_relative "torobi/quantization"
|
|
15
|
+
require_relative "torobi/models/build"
|
|
16
|
+
require_relative "torobi/models/padding"
|
|
17
|
+
require_relative "torobi/models/windows"
|
|
18
|
+
require_relative "torobi/models/description"
|
|
19
|
+
require_relative "torobi/models/modern_bert"
|
|
20
|
+
require_relative "torobi/models/gemma3"
|
|
21
|
+
require_relative "torobi/models/llama"
|
|
22
|
+
|
|
23
|
+
# The engine, and the session that drives it. Optional: the pure-Ruby half
|
|
24
|
+
# (the DSL and the IR) stands on its own, and its tests need no extension.
|
|
25
|
+
#
|
|
26
|
+
# Only the extension's own absence is caught. Everything after it is this
|
|
27
|
+
# library's, and a LoadError from one of those means something is wrong
|
|
28
|
+
# rather than uncompiled: swallowing it would make a missing require look
|
|
29
|
+
# exactly like "run rake compile", which is a wrong answer that reads as
|
|
30
|
+
# a right one (`benchmark` stopped being a default gem in Ruby 4.0, and
|
|
31
|
+
# that is the shape it would have arrived in).
|
|
32
|
+
begin
|
|
33
|
+
begin
|
|
34
|
+
# A checkout and a source build have one extension beside this file; a
|
|
35
|
+
# precompiled gem carries one per Ruby minor, under `torobi/<abi>/`,
|
|
36
|
+
# chosen here. The flat path is tried first so a checkout always loads
|
|
37
|
+
# what `rake compile` just built, not a staged copy.
|
|
38
|
+
require_relative "torobi/torobi"
|
|
39
|
+
rescue LoadError
|
|
40
|
+
require_relative "torobi/#{RUBY_VERSION[/\d+\.\d+/]}/torobi"
|
|
41
|
+
end
|
|
42
|
+
rescue LoadError
|
|
43
|
+
# Not compiled yet (rake compile); Torobi::Session is simply absent.
|
|
44
|
+
else
|
|
45
|
+
require_relative "torobi/metallib"
|
|
46
|
+
require_relative "torobi/preflight"
|
|
47
|
+
require_relative "torobi/tensor_data"
|
|
48
|
+
require_relative "torobi/weights"
|
|
49
|
+
require_relative "torobi/batch"
|
|
50
|
+
require_relative "torobi/checkpoint"
|
|
51
|
+
require_relative "torobi/session"
|
|
52
|
+
require_relative "torobi/memory"
|
|
53
|
+
require_relative "torobi/hooks"
|
|
54
|
+
require_relative "torobi/replay"
|
|
55
|
+
require_relative "torobi/runner"
|
|
56
|
+
require_relative "torobi/export"
|
|
57
|
+
require_relative "torobi/adapter_file"
|
|
58
|
+
require_relative "torobi/grad_cache"
|
|
59
|
+
require_relative "torobi/freshness"
|
|
60
|
+
Torobi::Freshness.warn!
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Torobi describes models and training objectives in Ruby, once, as an
|
|
64
|
+
# immutable GraphConfig; an MLX-backed engine executes them. Ruby owns the
|
|
65
|
+
# language, the engine owns the execution. See docs/plan.md.
|
|
66
|
+
module Torobi
|
|
67
|
+
end
|
data/licenses/MLX.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright © 2023 Apple Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/licenses/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
Torobi is MIT (see [`../LICENSE`](../LICENSE)). The engine links MLX's
|
|
4
|
+
compiled code, so a package that carries `torobi.bundle` carries these
|
|
5
|
+
notices with it; the binding also follows `mlx-rs`'s API and takes a few
|
|
6
|
+
small pieces from it, so its notice is here too.
|
|
7
|
+
|
|
8
|
+
| file | what | licence | holder |
|
|
9
|
+
|---|---|---|---|
|
|
10
|
+
| `MLX.txt` | MLX, the library itself | MIT | Apple Inc. (ml-explore) |
|
|
11
|
+
| `mlx-c.txt` | mlx-c, the C API the engine binds | MIT | ml-explore |
|
|
12
|
+
| `gguflib.txt` | gguflib, which MLX vendors | MIT | Georgi Gerganov |
|
|
13
|
+
| `mlx-rs.txt` | the binding's reference, not a dependency | MIT | Minghua Wu, David Chavez |
|
|
14
|
+
|
|
15
|
+
`docs/vendoring.md` is the long form: where each came from, and what a
|
|
16
|
+
redistributor owes.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Georgi Gerganov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/licenses/mlx-c.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 ml-explore
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/licenses/mlx-rs.txt
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
mlx-rs (https://github.com/oxiglade/mlx-rs)
|
|
2
|
+
Copyright (c) Minghua Wu, David Chavez
|
|
3
|
+
Dual-licensed under MIT or Apache-2.0; Torobi takes the MIT option.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any
|
|
6
|
+
person obtaining a copy of this software and associated
|
|
7
|
+
documentation files (the "Software"), to deal in the
|
|
8
|
+
Software without restriction, including without
|
|
9
|
+
limitation the rights to use, copy, modify, merge,
|
|
10
|
+
publish, distribute, sublicense, and/or sell copies of
|
|
11
|
+
the Software, and to permit persons to whom the Software
|
|
12
|
+
is furnished to do so, subject to the following
|
|
13
|
+
conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice
|
|
16
|
+
shall be included in all copies or substantial portions
|
|
17
|
+
of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
20
|
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
21
|
+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
22
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
|
23
|
+
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
24
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
25
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
26
|
+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
27
|
+
DEALINGS IN THE SOFTWARE.
|
metadata
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: torobi
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- takahashim
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: minitest
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '5.0'
|
|
19
|
+
type: :development
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '5.0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: rake
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '13.0'
|
|
33
|
+
type: :development
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '13.0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: rake-compiler
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '1.2'
|
|
47
|
+
type: :development
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '1.2'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: rb_sys
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - "~>"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0.9'
|
|
61
|
+
type: :development
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - "~>"
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '0.9'
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: rubocop
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - "~>"
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '1.80'
|
|
75
|
+
type: :development
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - "~>"
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '1.80'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: rubocop-minitest
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - "~>"
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '0.38'
|
|
89
|
+
type: :development
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - "~>"
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '0.38'
|
|
96
|
+
description: Torobi describes models and training objectives in a Ruby Graph DSL,
|
|
97
|
+
compiles them to an immutable GraphConfig IR, and executes training through an MLX-backed
|
|
98
|
+
engine. Aimed at fine-tuning and distilling known architectures locally, without
|
|
99
|
+
owning the training loop.
|
|
100
|
+
email:
|
|
101
|
+
- takahashimm@gmail.com
|
|
102
|
+
executables: []
|
|
103
|
+
extensions:
|
|
104
|
+
- ext/torobi/extconf.rb
|
|
105
|
+
extra_rdoc_files: []
|
|
106
|
+
files:
|
|
107
|
+
- CHANGELOG.md
|
|
108
|
+
- Cargo.lock
|
|
109
|
+
- Cargo.toml
|
|
110
|
+
- LICENSE
|
|
111
|
+
- README.md
|
|
112
|
+
- config/ops.yml
|
|
113
|
+
- docs/plan.md
|
|
114
|
+
- docs/vendoring.md
|
|
115
|
+
- engine/Cargo.toml
|
|
116
|
+
- engine/build.rs
|
|
117
|
+
- engine/src/checkpoint.rs
|
|
118
|
+
- engine/src/executor.rs
|
|
119
|
+
- engine/src/export.rs
|
|
120
|
+
- engine/src/fixtures.rs
|
|
121
|
+
- engine/src/graph.rs
|
|
122
|
+
- engine/src/init.rs
|
|
123
|
+
- engine/src/interp.rs
|
|
124
|
+
- engine/src/lib.rs
|
|
125
|
+
- engine/src/main.rs
|
|
126
|
+
- engine/src/memory.rs
|
|
127
|
+
- engine/src/mlxc/array.rs
|
|
128
|
+
- engine/src/mlxc/error.rs
|
|
129
|
+
- engine/src/mlxc/fast.rs
|
|
130
|
+
- engine/src/mlxc/handle.rs
|
|
131
|
+
- engine/src/mlxc/io.rs
|
|
132
|
+
- engine/src/mlxc/memory.rs
|
|
133
|
+
- engine/src/mlxc/metal.rs
|
|
134
|
+
- engine/src/mlxc/mod.rs
|
|
135
|
+
- engine/src/mlxc/nn.rs
|
|
136
|
+
- engine/src/mlxc/ops.rs
|
|
137
|
+
- engine/src/mlxc/quantized.rs
|
|
138
|
+
- engine/src/mlxc/random.rs
|
|
139
|
+
- engine/src/mlxc/transforms.rs
|
|
140
|
+
- engine/src/op.rs
|
|
141
|
+
- engine/src/optimizer.rs
|
|
142
|
+
- engine/src/plan.rs
|
|
143
|
+
- engine/src/runtime.rs
|
|
144
|
+
- engine/src/session.rs
|
|
145
|
+
- engine/src/state.rs
|
|
146
|
+
- engine/src/tensor.rs
|
|
147
|
+
- ext/torobi/Cargo.toml
|
|
148
|
+
- ext/torobi/extconf.rb
|
|
149
|
+
- ext/torobi/src/gvl.rs
|
|
150
|
+
- ext/torobi/src/lib.rs
|
|
151
|
+
- lib/torobi.rb
|
|
152
|
+
- lib/torobi/adapter_file.rb
|
|
153
|
+
- lib/torobi/batch.rb
|
|
154
|
+
- lib/torobi/checkpoint.rb
|
|
155
|
+
- lib/torobi/dsl.rb
|
|
156
|
+
- lib/torobi/dsl/builder.rb
|
|
157
|
+
- lib/torobi/dsl/handle.rb
|
|
158
|
+
- lib/torobi/dsl/layers.rb
|
|
159
|
+
- lib/torobi/errors.rb
|
|
160
|
+
- lib/torobi/export.rb
|
|
161
|
+
- lib/torobi/freeze.rb
|
|
162
|
+
- lib/torobi/freshness.rb
|
|
163
|
+
- lib/torobi/grad_cache.rb
|
|
164
|
+
- lib/torobi/graph_config.rb
|
|
165
|
+
- lib/torobi/hooks.rb
|
|
166
|
+
- lib/torobi/ir.rb
|
|
167
|
+
- lib/torobi/ir/dimensions.rb
|
|
168
|
+
- lib/torobi/ir/dtype.rb
|
|
169
|
+
- lib/torobi/ir/graph.rb
|
|
170
|
+
- lib/torobi/ir/graph/check.rb
|
|
171
|
+
- lib/torobi/ir/input_spec.rb
|
|
172
|
+
- lib/torobi/ir/json.rb
|
|
173
|
+
- lib/torobi/ir/node_spec.rb
|
|
174
|
+
- lib/torobi/ir/parameter_spec.rb
|
|
175
|
+
- lib/torobi/ir/ref.rb
|
|
176
|
+
- lib/torobi/ir/source.rb
|
|
177
|
+
- lib/torobi/journal.rb
|
|
178
|
+
- lib/torobi/lora.rb
|
|
179
|
+
- lib/torobi/memory.rb
|
|
180
|
+
- lib/torobi/metallib.rb
|
|
181
|
+
- lib/torobi/mlx_prebuilt.json
|
|
182
|
+
- lib/torobi/mlx_prebuilt.rb
|
|
183
|
+
- lib/torobi/models/build.rb
|
|
184
|
+
- lib/torobi/models/description.rb
|
|
185
|
+
- lib/torobi/models/gemma3.rb
|
|
186
|
+
- lib/torobi/models/llama.rb
|
|
187
|
+
- lib/torobi/models/modern_bert.rb
|
|
188
|
+
- lib/torobi/models/padding.rb
|
|
189
|
+
- lib/torobi/models/windows.rb
|
|
190
|
+
- lib/torobi/ops.rb
|
|
191
|
+
- lib/torobi/preflight.rb
|
|
192
|
+
- lib/torobi/provenance.rb
|
|
193
|
+
- lib/torobi/quantization.rb
|
|
194
|
+
- lib/torobi/replay.rb
|
|
195
|
+
- lib/torobi/runner.rb
|
|
196
|
+
- lib/torobi/session.rb
|
|
197
|
+
- lib/torobi/shape.rb
|
|
198
|
+
- lib/torobi/tensor_data.rb
|
|
199
|
+
- lib/torobi/version.rb
|
|
200
|
+
- lib/torobi/weights.rb
|
|
201
|
+
- licenses/MLX.txt
|
|
202
|
+
- licenses/README.md
|
|
203
|
+
- licenses/gguflib.txt
|
|
204
|
+
- licenses/mlx-c.txt
|
|
205
|
+
- licenses/mlx-rs.txt
|
|
206
|
+
homepage: https://github.com/takahashim/torobi
|
|
207
|
+
licenses:
|
|
208
|
+
- MIT
|
|
209
|
+
metadata:
|
|
210
|
+
rubygems_mfa_required: 'true'
|
|
211
|
+
rdoc_options: []
|
|
212
|
+
require_paths:
|
|
213
|
+
- lib
|
|
214
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
|
+
requirements:
|
|
216
|
+
- - ">="
|
|
217
|
+
- !ruby/object:Gem::Version
|
|
218
|
+
version: '3.3'
|
|
219
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
|
+
requirements:
|
|
221
|
+
- - ">="
|
|
222
|
+
- !ruby/object:Gem::Version
|
|
223
|
+
version: '0'
|
|
224
|
+
requirements: []
|
|
225
|
+
rubygems_version: 3.6.9
|
|
226
|
+
specification_version: 4
|
|
227
|
+
summary: 'A slow-cooking training framework for Apple Silicon: declare models in Ruby,
|
|
228
|
+
train them on MLX.'
|
|
229
|
+
test_files: []
|