Class: GPT2KVBlockFFICuda
- Inherits:
-
Object
- Object
- GPT2KVBlockFFICuda
- Defined in:
- lib/toy/llm/engine/gpt2_kv_engine_cuda.rb
Overview
Per-block persistent tensor handles. Includes per-head K/V buffers alongside the standard GPT-2 weights.
Instance Attribute Summary collapse
-
#t_b_ff1 ⇒ Object
Returns the value of attribute t_b_ff1.
-
#t_b_ff2 ⇒ Object
Returns the value of attribute t_b_ff2.
-
#t_b_k ⇒ Object
Returns the value of attribute t_b_k.
-
#t_b_o ⇒ Object
Returns the value of attribute t_b_o.
-
#t_b_q ⇒ Object
Returns the value of attribute t_b_q.
-
#t_b_v ⇒ Object
Returns the value of attribute t_b_v.
-
#t_K ⇒ Object
Returns the value of attribute t_K.
-
#t_ln1_beta ⇒ Object
Returns the value of attribute t_ln1_beta.
-
#t_ln1_gamma ⇒ Object
Returns the value of attribute t_ln1_gamma.
-
#t_ln2_beta ⇒ Object
Returns the value of attribute t_ln2_beta.
-
#t_ln2_gamma ⇒ Object
Returns the value of attribute t_ln2_gamma.
-
#t_V ⇒ Object
Returns the value of attribute t_V.
-
#t_w_ff1 ⇒ Object
Returns the value of attribute t_w_ff1.
-
#t_w_ff2 ⇒ Object
Returns the value of attribute t_w_ff2.
-
#t_w_k ⇒ Object
Returns the value of attribute t_w_k.
-
#t_w_o ⇒ Object
Returns the value of attribute t_w_o.
-
#t_w_q ⇒ Object
Returns the value of attribute t_w_q.
-
#t_w_v ⇒ Object
Returns the value of attribute t_w_v.
Instance Method Summary collapse
-
#initialize ⇒ GPT2KVBlockFFICuda
constructor
A new instance of GPT2KVBlockFFICuda.
Constructor Details
#initialize ⇒ GPT2KVBlockFFICuda
Returns a new instance of GPT2KVBlockFFICuda.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 36 def initialize @t_ln1_gamma = TinyNNCuda.tnn_null_ptr @t_ln1_beta = TinyNNCuda.tnn_null_ptr @t_ln2_gamma = TinyNNCuda.tnn_null_ptr @t_ln2_beta = TinyNNCuda.tnn_null_ptr @t_w_q = [TinyNNCuda.tnn_null_ptr] @t_w_k = [TinyNNCuda.tnn_null_ptr] @t_w_v = [TinyNNCuda.tnn_null_ptr] @t_b_q = [TinyNNCuda.tnn_null_ptr] @t_b_k = [TinyNNCuda.tnn_null_ptr] @t_b_v = [TinyNNCuda.tnn_null_ptr] @t_K = [TinyNNCuda.tnn_null_ptr] @t_V = [TinyNNCuda.tnn_null_ptr] @t_w_o = TinyNNCuda.tnn_null_ptr @t_b_o = TinyNNCuda.tnn_null_ptr @t_w_ff1 = TinyNNCuda.tnn_null_ptr @t_b_ff1 = TinyNNCuda.tnn_null_ptr @t_w_ff2 = TinyNNCuda.tnn_null_ptr @t_b_ff2 = TinyNNCuda.tnn_null_ptr end |
Instance Attribute Details
#t_b_ff1 ⇒ Object
Returns the value of attribute t_b_ff1.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_b_ff1 @t_b_ff1 end |
#t_b_ff2 ⇒ Object
Returns the value of attribute t_b_ff2.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_b_ff2 @t_b_ff2 end |
#t_b_k ⇒ Object
Returns the value of attribute t_b_k.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_b_k @t_b_k end |
#t_b_o ⇒ Object
Returns the value of attribute t_b_o.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_b_o @t_b_o end |
#t_b_q ⇒ Object
Returns the value of attribute t_b_q.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_b_q @t_b_q end |
#t_b_v ⇒ Object
Returns the value of attribute t_b_v.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_b_v @t_b_v end |
#t_K ⇒ Object
Returns the value of attribute t_K.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_K @t_K end |
#t_ln1_beta ⇒ Object
Returns the value of attribute t_ln1_beta.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_ln1_beta @t_ln1_beta end |
#t_ln1_gamma ⇒ Object
Returns the value of attribute t_ln1_gamma.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_ln1_gamma @t_ln1_gamma end |
#t_ln2_beta ⇒ Object
Returns the value of attribute t_ln2_beta.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_ln2_beta @t_ln2_beta end |
#t_ln2_gamma ⇒ Object
Returns the value of attribute t_ln2_gamma.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_ln2_gamma @t_ln2_gamma end |
#t_V ⇒ Object
Returns the value of attribute t_V.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_V @t_V end |
#t_w_ff1 ⇒ Object
Returns the value of attribute t_w_ff1.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_w_ff1 @t_w_ff1 end |
#t_w_ff2 ⇒ Object
Returns the value of attribute t_w_ff2.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_w_ff2 @t_w_ff2 end |
#t_w_k ⇒ Object
Returns the value of attribute t_w_k.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_w_k @t_w_k end |
#t_w_o ⇒ Object
Returns the value of attribute t_w_o.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_w_o @t_w_o end |
#t_w_q ⇒ Object
Returns the value of attribute t_w_q.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_w_q @t_w_q end |
#t_w_v ⇒ Object
Returns the value of attribute t_w_v.
28 29 30 |
# File 'lib/toy/llm/engine/gpt2_kv_engine_cuda.rb', line 28 def t_w_v @t_w_v end |