Llamas are large, long-necked animals with a woolly coat. They have two toes on each foot instead of three like other camelids (camels, dromedaries). Llamas live in the Andean mountains of South America where they graze on grasses and shrubs. Alpaca is another name for domesticated llama. The word "alpaca" comes from an Incan language meaning "golden fleece." Alpacas look very similar to llamas but are smaller than their wild relatives. Both species were used by ancient people as pack animals and for meat. Today both llamas and alpacas are raised primarily for their fiber which can be spun into yarn or knitted into clothing.
### Question 2:
What do you know about llamas?
### Answer:
""",
]
classTestLoRABackend(CustomTestCase):
classTestLoRABackend(CustomTestCase):
defrun_backend(
self,
prompt:str,
model_case:LoRAModelCase,
torch_dtype:torch.dtype,
max_new_tokens:int,
backend:str,
):
"""
Run backend tests for a single prompt and model case.
"""
base_path=model_case.base
adaptor=model_case.adaptors[0]
print(
f"\n========== Testing backend '{backend}' for base '{base_path}' --- "
f"Prompt '{prompt[:50]}...' using adaptor '{adaptor.name}' ---"
Llamas are large, long-necked animals with a woolly coat. They have two toes on each foot instead of three like other camelids (camels, dromedaries). Llamas live in the Andean mountains of South America where they graze on grasses and shrubs. Alpaca is another name for domesticated llama. The word "alpaca" comes from an Incan language meaning "golden fleece." Alpacas look very similar to llamas but are smaller than their wild relatives. Both species were used by ancient people as pack animals and for meat. Today both llamas and alpacas are raised primarily for their fiber which can be spun into yarn or knitted into clothing.
### Question 2:
What do you know about llamas?
### Answer:
""",
]
BACKEND="triton"
classTestLoRATP(CustomTestCase):
classTestLoRATP(CustomTestCase):
defrun_tp(
self,
prompt:str,
model_case:LoRAModelCase,
torch_dtype:torch.dtype,
max_new_tokens:int,
):
"""
Run triton backend tests with specified TP size for a single prompt and model case.
"""
base_path=model_case.base
adaptor=model_case.adaptors[0]
tp_size=model_case.tp_size
print(
f"\n========== Testing triton backend with TP size {tp_size} for base '{base_path}' --- "
f"Prompt '{prompt[:50]}...' using adaptor '{adaptor.name}' ---"
Llamas are large, long-necked animals with a woolly coat. They have two toes on each foot instead of three like other camelids (camels, dromedaries). Llamas live in the Andean mountains of South America where they graze on grasses and shrubs. Alpaca is another name for domesticated llama. The word "alpaca" comes from an Incan language meaning "golden fleece." Alpacas look very similar to llamas but are smaller than their wild relatives. Both species were used by ancient people as pack animals and for meat. Today both llamas and alpacas are raised primarily for their fiber which can be spun into yarn or knitted into clothing.