Model duplication for convenience
It's slow to load lots of models into memory from disk, especially if it's multiple instances of exactly the same model.
For convenience, it would be nice to be able to duplicate models (model.h).
A few pointers:
- The in-memory weights should be literally duplicated. For now, use
cudaMallocHost
to allocate host memory for the new weights - A new so memfile should be created, and the contents of the model's so should be duplicated into the new memfile.
The code to duplicate a model will roughly follow what Model::loadFromDisk
does in model.cpp.