Skip to content

CPU infer slow #25

Closed
Closed

Description

@OnceJune

Thank you for sharing your code. I tried on my own dataset(Chinese) with config:
{ "train": { "log_interval": 200, "eval_interval": 1000, "seed": 1234, "epochs": 10000, "learning_rate": 2e-4, "betas": [0.8, 0.99], "eps": 1e-9, "batch_size": 32, "fp16_run": false, "lr_decay": 0.999875, "segment_size": 8192, "init_lr_ratio": 1, "warmup_epochs": 0, "c_mel": 45, "c_kl": 1.0 }, "data": { "training_files":"filelists/mt_f065_train_filelist.txt", "validation_files":"filelists/mt_f065_val_filelist.txt", "text_cleaners":["collapse_whitespace"], "max_wav_value": 32768.0, "sampling_rate": 16000, "filter_length": 1024, "hop_length": 256, "win_length": 1024, "n_mel_channels": 80, "mel_fmin": 0.0, "mel_fmax": null, "add_blank": true, "n_speakers": 0, "cleaned_text": false }, "model": { "inter_channels": 192, "hidden_channels": 192, "filter_channels": 768, "n_heads": 2, "n_layers": 6, "kernel_size": 3, "p_dropout": 0.1, "resblock": "1", "resblock_kernel_sizes": [3,7,11], "resblock_dilation_sizes": [[1,3,5], [1,3,5], [1,3,5]], "upsample_rates": [8,8,2,2], "upsample_initial_channel": 512, "upsample_kernel_sizes": [16,16,4,4], "n_layers_q": 3, "use_spectral_norm": false, "gin_channels": 256 } }

And synthesis on CPU in 1 batch, but the speed is not as good as using GPU.
total audio length: 77.76s
total cost GPU: 4.84s
total cost CPU: 151.26s
average rtf GPU: 0.06
average rtf CPU: 1.95

I checked the checkpoint and found the G_*.pth file size is up to 445M.

My question is:

  1. Is the CPU infer time correct?
  2. Is the checkpoint I'm using correct?
  3. Could you kindly give any ideas about how to make CPU infer faster?

Thank you in advance

Activity

  1. OnceJune commented on Aug 10, 2021

    @OnceJune
    Author

    seems to be my pytorch problem, let me check

  2. OnceJune commented on Aug 10, 2021

    @OnceJune
    Author

    switch pytorch to 1.9.0+cpu, rtf decreased to 0.8

  3. OnceJune commented on Aug 11, 2021

    @OnceJune
    Author

    further more setting OMP_NUM_THREADS=8 make rtf down to 0.23, which is better than taco2+lpcnet in my env.

  4. BridgetteSong commented on Aug 16, 2021

    @BridgetteSong

    I think CPU infer time is normal. Because generator is HiFiGAN V1. If you want to run faster in CPU, you should change V1 config, the easiest is change upsample_initial_channel=256.

  5. OnceJune commented on Aug 16, 2021

    @OnceJune
    Author

    @BridgetteSong Thank you, I'll give a try.

  6. BillyBobQuebec commented on Aug 17, 2021

    @BillyBobQuebec

    @OnceJune I'm running my own tests as well to try and achieve the same speeds noted in the paper, it would be much appreciated if you can provide the specifications of what GPU and what CPU you were running these tests with, as well as what version of PyTorch were you using before switching to 1.9.0 ? and lastly, how many threads were you inferencing with on CPU, prior to you switching to using 8 threads?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions