-
Notifications
You must be signed in to change notification settings - Fork 39
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
Support model-loading from .npz files #341
Comments
Yes sounds good! |
@XapaJIaMnu: I had a brief conversation with @graemenail regarding the mmap path. The following is what I understood.
Because 2, (b) mentioned in #341 (comment) does not appear straightforward. #342 has a working prototype with (a), where we return an empty Also, please bear in mind I appreciate any help you can provide. |
ugh, this is a nightmare. |
Changes `ABORT` on non `.bin` model to an additional check for a `.npz` extension. If `.bin`, the fast load path is activated by returning `AlignedMemory`. Otherwise, the return of empty `AlignedMemory` causes fallback to filesystem-based loads. BRT: A test that checks if translation using `.npz` is approximately similar to that of default CLI translation is checked in to ensure stability going ahead. Previously, we only supported `.bin` models' loading via a fast mmap path. While we had the underlying capability to load non `.bin` models, this was not exposed, encouraging fast loads. Loading `.npz` models are helpful for quick debugging and broader coverage of models available, which will enhance user experience at translateLocally and python bindings. Fixes #341. See also: XapaJIaMnu/translateLocally#89
XapaJIaMnu/translateLocally#89
Marian supports this path. It may be possible for us to support this - but this shouldn't be at the cost of making
TranslationModel
complicated. Current path is:We have already expressed intention to clean a bit of
MemoryBundle
(affectinggetMemoryBundleFromConfig
) in #338. If we can find a way to (a) not load into MemoryBundle from.npz
, or alternatively, (b) load intoMemoryBundle
from.npz
we may be able to achieve what we want.We'd prefer (b) for when #257 is solved?
Marian checks based on extension https://github.com/marian-nmt/marian-dev/blob/b29cc07a95f49df7825f3a92e860bd642db0e812/src/common/io.cpp#L13-L21), which we can use.
@XapaJIaMnu sounds like the sketch of a plan?
The text was updated successfully, but these errors were encountered: