-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Labels
enhancementNew feature or requestNew feature or request
Description
When you experiment with different input sizes you want keep engines for them instead of being replaced with the engines generated when the model is built with a new input size.
Savant/savant/deepstream/nvinfer/file_config.py
Lines 93 to 123 in ca2d1bd
| @staticmethod | |
| def parse_model_engine_file(model_engine_file: str) -> Optional[Dict]: | |
| """Try to parse ``model-engine-file`` according to default Deepstream | |
| engine naming scheme.""" | |
| result = re.match( | |
| r'(?P<model_file>.*)' | |
| r'_b(?P<batch_size>\d+)' | |
| r'_gpu(?P<gpu_id>\d+)' | |
| r'_(?P<precision>fp32|fp16|int8)\.engine', | |
| model_engine_file, | |
| ) | |
| if not result: | |
| return None | |
| return { | |
| 'model_file': result['model_file'], | |
| 'batch_size': int(result['batch_size']), | |
| 'gpu_id': int(result['gpu_id']), | |
| 'precision': ModelPrecision[result['precision'].upper()], | |
| } | |
| @staticmethod | |
| def generate_model_engine_file( | |
| model_file: Optional[str], | |
| batch_size: int, | |
| device_id: str, | |
| precision: ModelPrecision, | |
| ) -> str: | |
| """Generate ``model-engine-file`` according to default Deepstream | |
| engine naming scheme.""" | |
| prefix = model_file if model_file else 'model' | |
| return f'{prefix}_b{batch_size}_{device_id}_{precision.name.lower()}.engine' |
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request