Class: Toy::LLM::Primitives::RoPE::Cfg

Inherits:
Object
  • Object
show all
Defined in:
lib/toy/llm/primitives/rope.rb,
lib/toy/llm/primitives/rope_cuda.rb,
lib/toy/llm/primitives/rope_metal.rb

Overview

Cfg value object — concrete scalar fields, Spinel-safe. All five scaling values are copied as plain Floats at realize time (decoupling the primitive from the RopeScaling object). freq_factors is intentionally NOT a field here: it is a per-realize FFI ptr passed explicitly to apply_2d.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(d_head, base, freq_scale, ext_factor, attn_factor, beta_fast, beta_slow) ⇒ Cfg

Returns a new instance of Cfg.



36
37
38
39
40
41
42
43
44
45
# File 'lib/toy/llm/primitives/rope.rb', line 36

def initialize(d_head, base, freq_scale, ext_factor,
               attn_factor, beta_fast, beta_slow)
  @d_head      = d_head
  @base        = base
  @freq_scale  = freq_scale
  @ext_factor  = ext_factor
  @attn_factor = attn_factor
  @beta_fast   = beta_fast
  @beta_slow   = beta_slow
end

Instance Attribute Details

#attn_factorObject

Returns the value of attribute attn_factor.



32
33
34
# File 'lib/toy/llm/primitives/rope.rb', line 32

def attn_factor
  @attn_factor
end

#baseObject

Returns the value of attribute base.



32
33
34
# File 'lib/toy/llm/primitives/rope.rb', line 32

def base
  @base
end

#beta_fastObject

Returns the value of attribute beta_fast.



32
33
34
# File 'lib/toy/llm/primitives/rope.rb', line 32

def beta_fast
  @beta_fast
end

#beta_slowObject

Returns the value of attribute beta_slow.



32
33
34
# File 'lib/toy/llm/primitives/rope.rb', line 32

def beta_slow
  @beta_slow
end

#d_headObject

Returns the value of attribute d_head.



32
33
34
# File 'lib/toy/llm/primitives/rope.rb', line 32

def d_head
  @d_head
end

#ext_factorObject

Returns the value of attribute ext_factor.



32
33
34
# File 'lib/toy/llm/primitives/rope.rb', line 32

def ext_factor
  @ext_factor
end

#freq_scaleObject

Returns the value of attribute freq_scale.



32
33
34
# File 'lib/toy/llm/primitives/rope.rb', line 32

def freq_scale
  @freq_scale
end