MCPcopy Create free account

hub / github.com/BICLab/SpikingBrain-7B / functions

Functions395 in github.com/BICLab/SpikingBrain-7B

↓ 48 callersFunctiontest_spike_matmul_equivalence
General test for verifying spike_matmul matches dense matmul output when using a given SpikeCount LIF quantizer. Args: x (torch.
W8ASpike/Int2Spike/test.py:149
↓ 24 callersFunctiontest_spike_count_bitwise_node
Test function for SpikeCountBitwiseNode using spike_fake_quant(). Args: x (torch.Tensor, optional): Input tensor with integer values
W8ASpike/Int2Spike/test.py:98
↓ 17 callersMethod__init__
(self, config)
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:605
↓ 9 callersMethodget
(self, layer_idx: int, cache_position: torch.LongTensor)
hf_7B_VLM/SpikingBrain_VL/utils.py:15
↓ 9 callersMethodupdate
Updates the cache with the new `recurrent_state`/`attn_state`/`conv_state` for the layer `layer_idx`. Args: recurrent_st
hf_7B_model/cache.py:40
↓ 8 callersFunctiontest_spike_count_binary_lif_node
Test function for SpikeCountBinaryLIFNode. Args: x (torch.Tensor, optional): Input tensor with non-negative integer values.
W8ASpike/Int2Spike/test.py:12
↓ 8 callersFunctiontest_spike_count_ternary_lif_node
Test function for SpikeCountTernaryLIFNode. Args: x (torch.Tensor, optional): Input tensor with integer values.
W8ASpike/Int2Spike/test.py:56
↓ 6 callersMethodget_seq_length
Returns the sequence length of the cached states. A layer index can be optionally passed.
hf_7B_model/cache.py:114
↓ 5 callersMethod__init__
( self, hidden_size: int, elementwise_affine: bool = True, bias: bool = False,
hf_7B_model/layernorm.py:628
↓ 5 callersMethod__init__
( self, hidden_size: int, intermediate_size: int, quant_config: Optional[Quant
vllm_hymeta/model_for_7B/modeling_gla_swa.py:97
↓ 5 callersMethodfiring_rate
Calculate the average firing rate of the spike sequence. For bidirectional coding: use absolute spike values. For unidirecti
W8ASpike/Int2Spike/neuron.py:40
↓ 5 callersMethodupdate
Updates the cache with the new `recurrent_state`/`attn_state`/`conv_state` for the layer `layer_idx`. Args: recurrent_st
W8ASpike/cache.py:40
↓ 5 callersMethodvisualize_spike
(self, max_neurons=30, max_token=20, filename="sample.png", title="", seed=42)
W8ASpike/Int2Spike/neuron.py:63
↓ 4 callersMethod__init__
( self, hidden_size: int, intermediate_size: Optional[int] = None, hidden_act:
W8ASpike/modeling_gla_swa.py:36
↓ 4 callersMethod__init__
( self, hidden_size: int, intermediate_size: Optional[int] = None, hidden_act:
hf_7B_model/modeling_gla_swa.py:35
↓ 4 callersMethodbatch_decode
This method forwards all its arguments to Qwen2TokenizerFast's [`~PreTrainedTokenizer.batch_decode`]. Please refer to the docstring o
hf_7B_VLM/SpikingBrain_VL/processing_spikingbrain_vl.py:108
↓ 4 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:665
↓ 4 callersFunctionrotate_half
Rotates half the hidden dims of the input.
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:189
↓ 4 callersFunctionspike_fake_quant
Simulate spike-based quantization and dequantization (fake quantization), with optional zero-point shifting. Args: x (torch.Tens
W8ASpike/Int2Spike/neuron.py:359
↓ 3 callersMethod__init__
(self,)
W8ASpike/Int2Spike/neuron.py:9
↓ 3 callersFunctionget_path
(*filepath)
setup.py:16
↓ 3 callersFunctionlayer_norm_linear_fn
( x, norm_weight, norm_bias, linear_weight, linear_bias, residual=None, eps=1e-6,
hf_7B_model/layernorm.py:774
↓ 3 callersFunctionmetatoken_flash_attn_varlen_func
( q1, q2, k1, k2, v1, v2, cu_seqlens_q=None, cu_seqlens_k=None, max_seqlen
vllm_hymeta/attention/fa_kernel_metatoken.py:324
↓ 3 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
W8ASpike/gla_attention.py:24
↓ 3 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
hf_7B_model/gla_attention.py:24
↓ 3 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
vllm_hymeta/model_for_7B/gla_attention.py:34
↓ 3 callersFunctionspike_quant
Quantize an integer tensor into spike sequences using a spike encoder. Supports optional zero-point shifting for bidirectional or unipolar mo
W8ASpike/Int2Spike/neuron.py:279
↓ 2 callersMethod_decode
(self, q, k, v, gk, kv_cache, state_indices_tensor, attn_metadata)
vllm_hymeta/model_for_7B/gla_attention.py:223
↓ 2 callersFunction_layer_norm_bwd
( dy, x, weight, bias, eps, mean, rstd, dresidual=None, has_residual=False
hf_7B_model/layernorm.py:303
↓ 2 callersFunction_layer_norm_fwd
( x, weight, bias, eps, residual=None, out_dtype=None, residual_dtype=None, is
hf_7B_model/layernorm.py:134
↓ 2 callersMethod_prepare_4d_causal_attention_mask_with_cache_position
Creates a causal 4D mask of shape `(batch_size, 1, query_length, key_value_length)` from a 2D mask of shape `(batch_size, key_value_l
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:1285
↓ 2 callersFunction_update_out_and_lse
( out: torch.Tensor, # [batch_size, seq_len, num_heads, head_dim] lse: torch.Tensor, # [batch_size, nu
vllm_hymeta/attention/fa_kernel_metatoken.py:111
↓ 2 callersFunctionapply_multimodal_rotary_pos_emb
Applies Rotary Position Embedding with Multimodal Sections to the query and key tensors Explanation: Multimodal 3D rotary position embedd
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:620
↓ 2 callersFunctionapply_rotary_pos_emb_vision
( q: torch.Tensor, k: torch.Tensor, cos: torch.Tensor, sin: torch.Tensor )
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:196
↓ 2 callersFunctiondynamic_spikes
(x, k=3.0)
W8ASpike/quant_linear.py:11
↓ 2 callersMethodfrom_legacy_cache
Converts a cache in the legacy cache format into an equivalent `Cache`.
W8ASpike/cache.py:128
↓ 2 callersMethodfrom_legacy_cache
Converts a cache in the legacy cache format into an equivalent `Cache`.
hf_7B_model/cache.py:128
↓ 2 callersMethodgenerate
(self, *args, **kwargs)
W8ASpike/modeling_gla_swa.py:330
↓ 2 callersMethodget_seq_length
Returns the sequence length of the cached states. A layer index can be optionally passed.
W8ASpike/cache.py:114
↓ 2 callersFunctionl2_norm
x: [b, l, d]
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:887
↓ 2 callersFunctionquantize_sym
(x, bit=8)
W8ASpike/window_attention.py:227
↓ 2 callersFunctionregister_7B_model
()
vllm_hymeta/model_for_7B/__init__.py:4
↓ 2 callersFunctionrepeat_kv
(hidden_states: torch.Tensor, n_rep: int)
hf_7B_VLM/SpikingBrain_VL/gla.py:19
↓ 2 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
W8ASpike/window_attention.py:82
↓ 2 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
hf_7B_model/window_attention.py:82
↓ 2 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
hf_7B_model/window_attention_sdpa.py:82
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
W8ASpike/window_attention.py:49
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
hf_7B_model/window_attention.py:49
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
hf_7B_model/window_attention_sdpa.py:49
↓ 2 callersFunctionswiglu_fwd
(x, y)
W8ASpike/activations.py:328
↓ 2 callersFunctionswiglu_fwd
(x, y)
hf_7B_model/activations.py:328
↓ 2 callersFunctionweight_to_bitwise
Convert integer weight tensor into its bitwise representation. - Ensures `w` is integer-valued. - If `w` contains negative values, shift
W8ASpike/Int2Spike/neuron.py:525
↓ 1 callersMethod__init__
( self, vocab_size=152064, hidden_size=8192, intermediate_size=29568,
hf_7B_VLM/SpikingBrain_VL/configuration_spikingbrain_vl.py:67
↓ 1 callersMethod__init__
( self, hidden_size: int = 1024, num_heads: Optional[int] = None,
W8ASpike/window_attention.py:95
↓ 1 callersMethod__init__
(self, in_features: int, out_features: int, w_group_size=None)
W8ASpike/quant_linear.py:53
↓ 1 callersMethod__init__
( self, hidden_size: int = 1024, num_heads: Optional[int] = None,
hf_7B_model/window_attention.py:95
↓ 1 callersMethod__init__
( self, hidden_size: int = 1024, num_heads: Optional[int] = None,
hf_7B_model/window_attention_sdpa.py:95
↓ 1 callersMethod__init__
( self, config: GLAswaConfig, hidden_size: int = 1024, num_heads: Optional[int
vllm_hymeta/model_for_7B/gla_attention.py:92
↓ 1 callersMethod_add_seq_group
Add a sequence group to the metadata. Specifically update/append 1. context length. 2. block table. 3. slot mapping.
vllm_hymeta/attention/meta_attention.py:435
↓ 1 callersMethod_build_sliding_causal_mask
Create a boolean attention mask for sliding-window + causal attention. True = masked, False = visible.
hf_7B_model/window_attention_sdpa.py:140
↓ 1 callersMethod_clear_prefill_cache
(self, attn_metadata, gla_cache_tensors: torch.Tensor, **kwargs)
vllm_hymeta/model_for_7B/modeling_gla_swa.py:391
↓ 1 callersMethod_compute_cos_sin_cache
(self)
vllm_hymeta/model_for_7B/modeling_gla_swa.py:70
↓ 1 callersMethod_compute_inv_freq
(self, base: float)
vllm_hymeta/model_for_7B/modeling_gla_swa.py:65
↓ 1 callersMethod_dynamic_frequency_update
dynamic RoPE layers should recompute `inv_freq` in the following situations: 1 - growing beyond the cached sequence length (allow sca
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:561
↓ 1 callersFunction_get_causal_option
Determine whether the given attention type is suitable for causal attention mechanisms. Args: attn_type (AttentionType): The ty
vllm_hymeta/attention/meta_attention.py:1051
↓ 1 callersMethod_get_graph_runner_block_tables
( self, num_seqs: int, block_tables: List[List[int]])
vllm_hymeta/attention/meta_attention.py:496
↓ 1 callersMethod_get_image_nums_and_video_nums
Get the number of images and videos for each sample to calculate the separation length of the sample tensor. These parameters are not
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:1926
↓ 1 callersFunction_get_query_key_seq_metadata
Returns sequence metadata for key and query based on the specified attention type and whether input is a prompt. This function computes
vllm_hymeta/attention/meta_attention.py:986
↓ 1 callersMethod_prefill_and_mix_infer
(self, q, k, v, gk, kv_cache, state_indices_tensor, attn_metadata)
vllm_hymeta/model_for_7B/gla_attention.py:179
↓ 1 callersFunction_read_requirements
(filename: str)
setup.py:31
↓ 1 callersMethod_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:1200
↓ 1 callersFunctionapply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
W8ASpike/window_attention.py:55
↓ 1 callersFunctionapply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
hf_7B_model/window_attention.py:55
↓ 1 callersFunctionapply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
hf_7B_model/window_attention_sdpa.py:55
↓ 1 callersFunctionapply_rotary_pos_emb_flashatt
( q: torch.Tensor, k: torch.Tensor, cos: torch.Tensor, sin: torch.Tensor )
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:137
↓ 1 callersMethodat_layer_idx
(self, layer_idx)
vllm_hymeta/model_for_7B/gla_cache.py:13
↓ 1 callersFunctionbias_gelu
(y, bias)
W8ASpike/activations.py:195
↓ 1 callersFunctionbias_gelu
(y, bias)
hf_7B_model/activations.py:195
↓ 1 callersFunctionbias_gelu_bwd
Assume that y has shape (B, D) and bias has shape (D)
W8ASpike/activations.py:204
↓ 1 callersFunctionbias_gelu_bwd
Assume that y has shape (B, D) and bias has shape (D)
hf_7B_model/activations.py:204
↓ 1 callersFunctiondequant
Full dequantization: decode spike sequence to pulse count, then map to float using dequantizer. Args: spike (torch.Tensor): Spike se
W8ASpike/Int2Spike/neuron.py:404
↓ 1 callersFunctiongelu_bwd
(g, x)
W8ASpike/activations.py:246
↓ 1 callersFunctiongelu_bwd
(g, x)
hf_7B_model/activations.py:246
↓ 1 callersFunctiongelu_fwd
(x)
W8ASpike/activations.py:238
↓ 1 callersFunctiongelu_fwd
(x)
hf_7B_model/activations.py:238
↓ 1 callersMethodgenerate
(self, *args, **kwargs)
hf_7B_model/modeling_gla_swa.py:326
↓ 1 callersMethodget_input_embeddings
(self, input_ids: torch.Tensor)
vllm_hymeta/model_for_7B/modeling_gla_swa.py:416
↓ 1 callersFunctionget_requirements
Get Python package dependencies from requirements.txt.
setup.py:28
↓ 1 callersMethodget_rope_index
Calculate the 3D rope index based on image and video's temporal, height and width in LLM. Explanation: Each embedding se
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:1502
↓ 1 callersMethodget_supported_head_sizes
()
vllm_hymeta/attention/meta_attention.py:58
↓ 1 callersMethodget_window_index
(self, grid_thw)
hf_7B_VLM/SpikingBrain_VL/modeling_spikingbrain_vl.py:442
↓ 1 callersFunctiongroup_norm_fn
( x, weight, bias, residual=None, eps=1e-6, prenorm=False, residual_in_fp32=False,
hf_7B_model/layernorm.py:491
↓ 1 callersFunctionlayer_norm_fn
( x, weight, bias, residual=None, eps=1e-6, prenorm=False, residual_in_fp32=False,
hf_7B_model/layernorm.py:469
↓ 1 callersFunctionmetatoken_flash_attn_with_kvcache
( q1, q2, k2, v2, key_cache=None, value_cache=None, cache_seqlens=None, num_me
vllm_hymeta/attention/fa_kernel_metatoken.py:282
↓ 1 callersFunctionmy_flash_attn_with_kvcache
( q, k_cache, v_cache, k=None, v=None, rotary_cos=None, rotary_sin=None, cache
vllm_hymeta/attention/fa_kernel_metatoken.py:26
↓ 1 callersFunctionmy_fused_recurrent
( q, k, v, g=None, kv_caches: torch.Tensor = None, slot_idx: torch.Tensor = None,
vllm_hymeta/model_for_7B/my_fused_recurrent.py:123
↓ 1 callersFunctionmy_fused_recurrent_gla
( q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, g: torch.Tensor = None, kv_caches: to
vllm_hymeta/model_for_7B/my_fused_recurrent.py:138
↓ 1 callersMethodneuronal_charge
(self, x: torch.Tensor)
W8ASpike/Int2Spike/neuron.py:137
↓ 1 callersMethodneuronal_charge
(self, x: torch.Tensor)
W8ASpike/Int2Spike/neuron.py:184
↓ 1 callersMethodneuronal_charge
(self, x: torch.Tensor)
W8ASpike/Int2Spike/neuron.py:262
next →1–100 of 395, ranked by callers