MCPcopy Create free account

hub / github.com/EverMind-AI/MSA / functions

Functions265 in github.com/EverMind-AI/MSA

↓ 1 callersMethodmerge_poolig_doc_id
(self, device)
src/msa_service.py:221
↓ 1 callersFunctionmsa_benchmark
(args, data)
src/app/benchmark.py:223
↓ 1 callersMethodnum_model_layers
(self)
src/prefill.py:55
↓ 1 callersFunctionpacking_dataset
(dataset, tokenizer, cutoff_len, num_worker, cache_dataset_overwrite)
src/utils/data_utils.py:280
↓ 1 callersFunctionparse_args
()
src/app/benchmark.py:181
↓ 1 callersFunctionparse_benchmark_file
(args)
src/app/benchmark.py:39
↓ 1 callersFunctionparse_score_result
解析 LLM 返回的评分结果,返回 0-5 的分数
src/evaluation/llm_judge.py:73
↓ 1 callersFunctionpost_process_generate_ids
(tokenizer: PreTrainedTokenizer, ids: torch.Tensor)
src/utils/common.py:28
↓ 1 callersMethodprefill_stage2
(self, layer_idx: int, query_states: torch.Tensor, query_mask: torch.Tensor)
src/msa_service.py:703
↓ 1 callersFunctionpreprocess_sp_dataset
(seq_ids, world_size, sequence_parallel_mode)
src/utils/data_utils.py:205
↓ 1 callersFunctionprint_model_stats
通用模型参数统计工具。 自动识别是 Dense 还是 MoE 模型,并计算 Total vs Active 参数量。
src/utils/common.py:101
↓ 1 callersFunctionprocess_results
(requests: List[Dict], index_to_doc, doc_to_index)
src/app/benchmark.py:137
↓ 1 callersFunctionread_config_to_args
(config_path)
src/app/benchmark.py:214
↓ 1 callersMethodrecord_kwargs
(self, layer_idx, kwargs)
src/utils/cache.py:143
↓ 1 callersMethodrecv_meta
(q: mp.Queue)
src/prefill.py:108
↓ 1 callersMethodrelease
释放一个执行权限,唤醒等待的请求
src/utils/tools.py:85
↓ 1 callersMethodrespond
(self)
src/msa_service.py:153
↓ 1 callersFunctionsave_checkpoint
(model, tokenizer, save_model_path)
src/utils/resave_model.py:9
↓ 1 callersMethodsave_idx_to_doc
(self, idx_to_doc: Dict[int, str])
src/msa_service.py:494
↓ 1 callersFunctionscale_memory
(context, query, scale=3)
src/utils/scale.py:4
↓ 1 callersFunctionsearch_for_fit
r""" Finds the index of largest number that fits into the knapsack with the given capacity.
src/utils/data_utils.py:106
↓ 1 callersMethodsend_documents
(q: mp.Queue, docs)
src/prefill.py:102
↓ 1 callersMethodsequence_pooling_kv
(self, key_states, value_states, doc_indices, global_chunk_ids)
src/msa/memory_sparse_attention.py:467
↓ 1 callersMethodsequence_pooling_qkv
(self, query_states, key_states, value_states, doc_indices, global_chunk_ids)
src/msa/memory_sparse_attention.py:488
↓ 1 callersMethodserialize
安全分片序列化: 1. 创建目录 2. 保存元数据 (meta.pt) 3. 逐层保存 Tensor 到独立文件,避免内存峰值
src/msa_service.py:351
↓ 1 callersMethodset_memory_client
(self, memory_client)
src/msa/memory_sparse_attention.py:65
↓ 1 callersFunctionset_seed
固定所有随机种子以确保实验的可复现性。
src/app/benchmark.py:23
↓ 1 callersMethodsetup_memory_client
(self, model)
src/msa_service.py:1057
↓ 1 callersFunctionshould_regenerate
return a text if the response should be regenerated, or return None
src/app/benchmark.py:202
↓ 1 callersFunctionsort_requests
创建动态批次:按照input_id长度排序,然后根据max_input_length分批
src/app/benchmark.py:69
↓ 1 callersMethodsplit_docs
(docs: List[Document], block_size: int)
src/prefill.py:75
↓ 1 callersMethodstart_all
启动所有GPU监控
src/utils/gpu_monitor.py:276
↓ 1 callersMethodstart_workers
(self)
src/msa_service.py:1653
↓ 1 callersMethodstop_workers
(self)
src/msa_service.py:1668
↓ 1 callersMethodupdate
( self, key_states: torch.Tensor, value_states: torch.Tensor, layer_idx: int,
src/msa_service.py:104
↓ 1 callersMethodwait_for_ready
(q: mp.Queue)
src/prefill.py:94
FunctionPrint
(*args)
src/utils/misc.py:47
Method__del__
析构函数,确保清理资源
src/utils/gpu_monitor.py:207
Method__enter__
(self)
src/msa_service.py:1645
Method__exit__
(self, exc_type, exc_val, exc_tb)
src/msa_service.py:1648
Method__getattr__
(self, attr)
src/utils/misc.py:25
Method__getstate__
(self)
src/msa/configuration_msa.py:12
Method__init__
(self, _distributed_cache_data=None)
src/msa_service.py:92
Method__init__
(self, gpu_id: int, generate_config: GenerateConfig, model_
src/msa_service.py:1014
Method__init__
(self, generate_config: GenerateConfig, model_config: ModelConfig,
src/msa_service.py:1369
Method__init__
(self, bench_name: str)
src/benchmarks.py:104
Method__init__
该 worker 被MemoryWorker创建并仅执行prefill stage 1获取block 的kv cache
src/prefill.py:40
Method__init__
(self, msa_config=None, **kwargs)
src/msa/configuration_msa.py:29
Method__init__
(self, config: Qwen3Config, layer_idx: int)
src/msa/memory_sparse_attention.py:21
Method__init__
(self, config: Qwen3Config, layer_idx: int, attn_type: str = "sparse_attention")
src/msa/model.py:52
Method__init__
(self, config)
src/msa/model.py:283
Method__init__
(self, *args, **kwargs)
src/utils/misc.py:10
Method__init__
(self, _distributed_cache_data=None)
src/utils/cache.py:140
Method__init__
(self, cache_config)
src/utils/cache.py:179
Method__init__
初始化请求限流器 Args: max_concurrent: 最大并发请求数,默认10
src/utils/tools.py:59
Method__init__
(self, disabled=False)
src/utils/tools.py:102
Method__init__
(self)
src/utils/callbacks.py:21
Method__init__
(self, _run=None)
src/utils/callbacks.py:52
Method__init__
(self, _run=None, multitest=None, trainer=None, gen_kwargs=None)
src/utils/callbacks.py:100
Method__init__
(self, prof)
src/utils/callbacks.py:168
Method__init__
(self, gpu_id: int, envs: dict)
src/utils/gpu_worker.py:6
Method__init__
初始化GPU显存监控器 Args: gpu_index: 要监控的GPU索引,默认0 interval: 监控间隔时间(秒),默认1秒 unit: 返回的单位,支持 'MB'
src/utils/gpu_monitor.py:9
Method__init__
初始化多GPU监控器 Args: gpu_indices: 要监控的GPU索引列表,None表示监控所有GPU interval: 监控间隔 unit: 返回的单位
src/utils/gpu_monitor.py:253
Method__post_init__
(self)
src/msa_service.py:46
Method__post_init__
(self)
src/msa_service.py:53
Method__post_init__
(self)
src/msa_service.py:63
Method__post_init__
(self)
src/msa_service.py:72
Method__post_init__
(self)
src/msa_service.py:81
Method__post_init__
(self)
src/msa_service.py:88
Method__post_init__
(self)
src/msa_service.py:130
Method__post_init__
(self)
src/config/memory_config.py:18
Method__repr__
(self)
src/benchmarks.py:119
Method__setattr__
重写 __setattr__,确保设置 msa_config 时自动转换为 DotDict
src/msa/configuration_msa.py:34
Method__setstate__
(self, state)
src/msa/configuration_msa.py:15
Function_get_cosine_schedule_with_warmup_lr_lambda
( current_step: int, *, num_warmup_steps: int, num_training_steps: int, num_cycles: float )
src/utils/misc.py:72
Method_monitor_loop
监控循环,运行在单独线程中
src/utils/gpu_monitor.py:74
Method_sample
( self, input_ids: torch.LongTensor, logits_processor: LogitsProcessorList, st
src/msa/generate.py:23
Method_setup_module
(module)
src/msa_service.py:1058
Methodadd
(self, name)
src/utils/tools.py:106
Methodclear_kvcache
(self)
src/utils/cache.py:202
Methodclear_query
清理查询相关的临时数据 移除查询过程中产生的临时数据,保持缓存清洁
src/utils/cache.py:66
Methodclear_query
清理查询相关的临时数据 移除查询过程中产生的临时数据,保持缓存清洁
src/utils/cache.py:300
Functionclip_grad_norm_
r"""Clips gradient norm of an iterable of parameters. The norm is computed over all gradients together, as if they were concatenated into a s
src/utils/misc.py:87
Methodcompute_pooled_states_via_cumsum
(states, counts_view, lengths)
src/msa/memory_sparse_attention.py:475
Methodcopy
创建缓存的深拷贝 Returns: CustomQuantizeDynamicCache: 缓存的新副本
src/utils/cache.py:317
Functioncopy_dict_to_cpu
(d: dict)
src/utils/cache.py:427
Functioncopy_dict_to_gpu
(d: dict, device)
src/utils/cache.py:433
Functioncopy_kv_cache_to_device
(cache_obj, cuda_device, copy_v: bool=True)
src/utils/cache.py:441
Functiondata_post_process_sequence_parallel
( dataset, training_args, sequence_parallel_size, sequence_parallel_mode, cutoff_len,
src/utils/data_utils.py:296
Functiondecode_generate_ids
(tokenizer: PreTrainedTokenizer, ids: torch.Tensor)
src/utils/common.py:36
Methoddefault_callback
(self, texts: List[str], recall_topk, userdata)
src/msa_service.py:1794
Methoddoc_query
(self, query_states: torch.Tensor, attention_mask: torch.Tensor, layer_idx: int)
src/msa_service.py:263
Functiondraw_bounding_boxes
( image: Union[torch.Tensor, PIL.Image.Image], boxes: Union[torch.Tensor, List, np.ndarray],
src/utils/common.py:49
Functionenable_explicit_format
()
src/utils/common.py:93
Functioneval_all
(predict, label)
src/app/benchmark.py:116
Methodfetch
(tensor, slot_idx)
src/msa_service.py:1250
Methodforward
( self, hidden_states: torch.Tensor, doc_ids: torch.LongTensor, attention_mask
src/msa/memory_sparse_attention.py:68
Methodforward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
src/msa/model.py:67
Methodforward
( self, input_ids: Optional[torch.LongTensor] = None, attention_mask: Optional[torch.T
src/msa/model.py:156
Methodforward
r""" labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing the masked lan
src/msa/model.py:332
← previousnext →101–200 of 265, ranked by callers