Comments (5)
Thanks for reporting. When testing, I found another behavior that should be improved: #127.
Let me know if there are other issues like these. I did not test the device placement thoroughly.
from ctranslate2.
Thanks for the quick fix.
This seems to fix the python case, but not the translate
cli though.
(Pulled repo and rebuilt docker image from scratch.)
from ctranslate2.
Right. The API usage is slightly different.
from ctranslate2.
The issue seem to be appearing again on master:
>>> import ctranslate2
>>> translator = ctranslate2.Translator("ende_ctranslate2", device="cuda", device_index=0)
>>> translator.translate_batch([["▁H", "ello", "▁world", "!"]])
[[{'score': -1.736800193786621, 'tokens': ['▁Hallo', '▁Welt', '!']}]]
>>> del translator
>>> translator = ctranslate2.Translator("ende_ctranslate2", device="cuda", device_index=1)
>>> translator.translate_batch([["▁H", "ello", "▁world", "!"]])
[[{'score': -1.736800193786621, 'tokens': ['▁Hallo', '▁Welt', '!']}]]
>>> del translator
terminate called after throwing an instance of 'std::runtime_error'
what(): /root/ctranslate2-dev/src/primitives/cuda.cu:72: CUDA failed with error invalid resource handle
Aborted (core dumped)
The error does not happen when deleting the object right after building it, without performing any translation.
from ctranslate2.
Thanks. I can reproduce this.
I will look to provide a more robust fix to this issue.
from ctranslate2.
Related Issues (20)
- PROBLEM converting phi2, phi1.5, and phi1 models HOT 8
- Translator.unload_model(to_cpu=True) takes long time HOT 8
- `translate_iterable` is not properly handling `max_input_length` HOT 2
- Whisper batch generation is not faster than loops HOT 5
- Support for Zephyr and other "StableLmForCausalLM" models? HOT 2
- Benchmarking Whisper on ctranslate2, llama.cpp, and bitsandbytes HOT 1
- Deploying with model and tensor parallelism HOT 3
- When building from source missing C++ libraries HOT 6
- int8 quantization not working HOT 1
- I try to pytest but it complains that "AttributeError: module 'ctranslate2' has no attribute 'get_cuda_device_count'" HOT 5
- Error when converting NMT model with ALiBi or RoPe HOT 2
- [Gemma] GELU should be approx tanh not exact HOT 2
- Asking about the return_scores during generation HOT 7
- 4.2.0 release build for python 3.9 HOT 13
- include/ctranslate2/ops/flash-attention/flash_fwd_launch_template.h(15): error: identifier "__grid_constant__" is undefined HOT 3
- `unload_model` support for `Generator` HOT 3
- No kernel image is available for execution on the device HOT 1
- Use generator as translator? HOT 3
- Does fairseq transform align can returns the alignment result? HOT 3
- Running Llama3 like a genius (that I am not) [SOLVED]: HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctranslate2.