在跑tuplan的训练模型时,发现第一次运行时,训练速度很慢,查看了一下nvidia-smi,发现GPU没有工作。这种情况是因为没有生成cache,所以在epoch0时运行速度很慢。
正确的方法是在配置文件中更改
py_func=cache,
cache.force_feature_computation=True
以下是tutorial原文:
- If preprocessing takes a large amount of time, it can cause training to fail (especially in a distributed setting). It may be beneficial to create the feature cache by first running the caching with the argument
py_func=cache cache.force_feature_computation=True
. This will generate the features using CPU, which should speed up training dramatically. Once caching is complete, supply the overridescache.force_feature_computation=False cache.cache_path=/path/to/cache cache.use_cache_without_dataset=True
to avoid re-computing the features.