Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Speedster] optimize_model took 10 hours, and it's not over yet #354

Open
wanglongwork opened this issue Sep 14, 2023 · 0 comments
Open

Comments

@wanglongwork
Copy link

wanglongwork commented Sep 14, 2023

  class SmilingEncode(nn.Module):
      
      def __init__(self, model):
          super().__init__()
          self.model = model
  
      def forward(self, xT, cond2):
          img = self.model.render_speedster(xT, cond2)   
          return img 
          
  xT_model = SmilingXT(model).to(device).eval()
  
  input_data = [((torch.randn(1, 3, 256, 256), torch.randn(1, 512)), torch.tensor([0])) for _ in range(100)]
  
  xT_optimized_model = optimized_model = optimize_model(
    xT_model, input_data=input_data, optimization_time="unconstrained", device=device)   
  
  save_model(xT_optimized_model, "speedster/xT_optimized_model")

2023-09-13 18:19:45 | INFO | Running Speedster on GPU:1
2023-09-13 18:23:05 | INFO | Benchmark performance of original model
2023-09-13 18:27:29 | INFO | Original model latency: 2.0304924035072327 sec/iter
============= Diagnostic Run torch.onnx.export version 2.0.1+cu117 =============
verbose: False, log level: Level.ERROR
======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ========================

2023-09-13 19:07:56 | INFO | [1/2] Running PyTorch Optimization Pipeline
2023-09-13 19:07:57 | INFO | Optimizing with TorchScriptCompiler and q_type: None.
2023-09-13 19:07:58 | WARNING | Unable to trace model with torch.fx
2023-09-13 19:07:59 | WARNING | Optimization failed with DeepLearningFramework.PYTORCH interface of ModelCompiler.TORCHSCRIPT. Got error LitModel is not attached to a Trainer.. If possible the compilation will be re-scheduled with another interface. Please consult the documentation for further info or open an issue on GitHub for receiving assistance.
2023-09-13 19:08:00 | INFO | Optimizing with TorchScriptCompiler and q_type: QuantizationType.HALF.
2023-09-13 19:08:00 | WARNING | Unable to trace model with torch.fx
2023-09-13 19:08:02 | WARNING | Optimization failed with DeepLearningFramework.PYTORCH interface of ModelCompiler.TORCHSCRIPT. Got error LitModel is not attached to a Trainer.. If possible the compilation will be re-scheduled with another interface. Please consult the documentation for further info or open an issue on GitHub for receiving assistance.
2023-09-13 19:08:02 | INFO | Optimizing with PyTorchTensorRTCompiler and q_type: None.
2023-09-13 19:08:04 | WARNING | Optimization failed with DeepLearningFramework.PYTORCH interface of ModelCompiler.TENSOR_RT_TORCH. Got error LitModel is not attached to a Trainer.. If possible the compilation will be re-scheduled with another interface. Please consult the documentation for further info or open an issue on GitHub for receiving assistance.
2023-09-13 19:08:05 | INFO | Optimizing with PyTorchTensorRTCompiler and q_type: QuantizationType.HALF.
2023-09-13 19:08:07 | WARNING | Optimization failed with DeepLearningFramework.PYTORCH interface of ModelCompiler.TENSOR_RT_TORCH. Got error LitModel is not attached to a Trainer.. If possible the compilation will be re-scheduled with another interface. Please consult the documentation for further info or open an issue on GitHub for receiving assistance.
2023-09-13 19:08:08 | INFO | [2/2] Running ONNX Optimization Pipeline
2023-09-13 19:08:08 | INFO | Optimizing with ONNXCompiler and q_type: None.
2023-09-13 19:08:10 | WARNING | TensorrtExecutionProvider for onnx is not available. If you want to use it, please add the path to tensorrt to the LD_LIBRARY_PATH environment variable. CUDA provider will be used instead.
2023-09-13 19:12:14 | INFO | Optimized model latency: 1.540417194366455 sec/iter
2023-09-13 19:12:14 | INFO | Optimizing with ONNXCompiler and q_type: QuantizationType.HALF.

It took 10 hours, and it's not over yet,why?

@wanglongwork wanglongwork changed the title It took 10 hours, and it's not over yet [Speedster] optimize_model took 10 hours, and it's not over yet Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant