MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / create

Method create

trinity/utils/distributed.py:114–133  ·  view source on GitHub ↗

Factory method to create the appropriate weight transfer engine based on the rollout engine type.

(
        engine_type: str, master_address: str, master_port: int, world_size: int, group_name: str
    )

Source from the content-addressed store, hash-verified

112
113 @staticmethod
114 def create(
115 engine_type: str, master_address: str, master_port: int, world_size: int, group_name: str
116 ):
117 """Factory method to create the appropriate weight transfer engine based on the rollout engine type."""
118 if engine_type == "vllm":
119 return VLLMWeightTransferEngine(
120 master_address=master_address,
121 master_port=master_port,
122 world_size=world_size,
123 group_name=group_name,
124 )
125 elif engine_type == "sglang":
126 return SGLangWeightTransferEngine(
127 master_address=master_address,
128 master_port=master_port,
129 world_size=world_size,
130 group_name=group_name,
131 )
132 else:
133 raise ValueError(f"Unsupported engine type: {engine_type}")
134
135
136class VLLMWeightTransferEngine(WeightTransferEngine):

Callers 15

build_verl_configFunction · 0.80
init_modelMethod · 0.80
init_modelMethod · 0.80
init_modelMethod · 0.80
_normalize_mappingFunction · 0.80
get_judge_rewardMethod · 0.80
get_ruler_scoresMethod · 0.80
judge_resultMethod · 0.80

Tested by 15

processMethod · 0.64
run_agentFunction · 0.64
run_asyncMethod · 0.64
run_asyncMethod · 0.64
run_math_workflowFunction · 0.64
test_generateMethod · 0.64
test_model_lenMethod · 0.64
test_model_lenMethod · 0.64
test_apiMethod · 0.64
test_logprobs_apiMethod · 0.64