Commit Graph

87 Commits

Author SHA1 Message Date
henk717 b808f039ab
Pin TPU driver 2023-04-23 20:21:28 +02:00
henk717 d88f109073
TPU Fix Fix 2023-04-23 18:49:25 +02:00
Bogdan Drema 92a0bf9524 Fix: TPU driver error
to_dlpack/from_dlpack was causing issues with tensor with new jax version
2023-04-23 00:49:42 +01:00
Henk eeb1774d42 Cleaner implementation of zipfolder 2022-12-10 19:23:08 +01:00
Henk 9a8e8a0005 New pytorch zipfile support 2022-12-10 19:11:07 +01:00
vfbd 9a3f0eaab2 Only enable TPU transpose optimization if loading from HF model 2022-11-21 13:47:18 -05:00
Henk eb52ebd082 Merge branch 'main' into united 2022-11-03 00:22:30 +01:00
vfbd b20d80ca2a Add vocab padding to embedding bias in gptj.json 2022-11-02 19:02:09 -04:00
vfbd bdc73ef393 Decrease TPU loading times by eliminating a transpose operation 2022-10-12 14:31:18 -04:00
vfbd 323f593a96 Custom unpickler to avoid pickle's arbitrary code execution vulnerability 2022-10-06 20:08:08 -04:00
vfbd bdfa6d86b7 Seed has to be a 64-bit unsigned int or PyTorch will throw an error
tpu_mtj_backend's seed can be an integer of arbitrary size but we will
limit it to a 64-bit unsigned integer anyways for consistency.
2022-10-02 17:50:32 -04:00
vfbd 1a59a4acea Allow changing sampler seed and sampler order from API 2022-10-02 16:25:51 -04:00
Henk 6c32bc18d7 GPT2Tokenizer for TPU 2022-09-27 18:33:31 +02:00
Henk 11455697ef Tokenizer Fixes (Slow first to keep coherency) 2022-09-27 17:57:18 +02:00
Henk 07896867b2 Revert Tokenizer Change 2022-09-27 15:36:08 +02:00
Henk 82a250aa1b Revert "Fix tokenizer selection code"
This reverts commit 7fba1fd28a.
2022-09-27 15:33:08 +02:00
vfbd 79ae0f17ec Merge branch 'main' into merge 2022-09-26 16:10:10 -04:00
vfbd 7fba1fd28a Fix tokenizer selection code 2022-09-26 14:37:25 -04:00
vfbd 943614b5e6 Merge branch 'main' into dependency-fix 2022-09-15 17:33:48 -04:00
vfbd 7bf6c9a23f Remove TPU Colab's dependency on optax and chex 2022-09-15 13:47:48 -04:00
vfbd cbacfbdfac Fix error that occurs when using dynamic TPU backend 2022-08-27 17:42:49 -04:00
vfbd 938e1eddf3 Fix `jax.lax.cond` call 2022-08-23 18:13:46 -04:00
vfbd 6ffaf43548 Repetition penalty is now sampler #6 in the sampler order 2022-08-23 15:10:21 -04:00
vfbd 74922966bd Merge branch 'avril' into rep-pen-order 2022-08-23 14:47:29 -04:00
henk717 9e140e3ba9
Merge branch 'KoboldAI:main' into united 2022-07-05 21:35:53 +02:00
vfbd 2a78b66932 Fix base OPT-125M and finetuned OPT models in Colab TPU instances 2022-07-05 15:28:58 -04:00
vfbd 048bd0ff3b Add support for setting the RNG seed and full determinism 2022-06-28 13:21:05 -04:00
Henk 6a89ad5b94 Merge branch 'main' into united 2022-06-23 21:07:56 +02:00
henk717 d94f29a68a
Merge pull request #127 from VE-FORBRYDERNE/tracer
Fix JAX UnexpectedTracerError
2022-06-23 19:29:51 +02:00
Gnome Ann 33a2a318db Fix 20B TPU model 2022-06-21 17:16:01 -04:00
Gnome Ann 0ea4fa9c87 Automatically calculate badwords and pad_token_id 2022-06-21 14:35:52 -04:00
Gnome Ann ea7d278ff4 Fix 20B TPU model 2022-06-21 13:16:45 -04:00
Gnome Ann 5e71f7fe97 Use slow tokenizer if fast tokenizer is not available 2022-06-17 21:08:37 -04:00
Gnome Ann 2d3db7b4ba Implement support for sampler order in the backend code 2022-06-13 19:12:23 -04:00
Gnome Ann fdb2a7fa4c Top-A sampling 2022-06-10 22:28:20 -04:00
Gnome Ann f2558e39d9 Fix JAX UnexpectedTracerError 2022-05-31 13:25:41 -04:00
Gnome Ann 707316de31 Kaggle TPU support 2022-05-31 12:20:16 -04:00
Gnome Ann d4e8f56789 Remove debugging code from tpu_mtj_backend.py 2022-05-14 12:00:44 -04:00
Gnome Ann 0c5ca5261e Loading a sharded model will now display only one progress bar 2022-05-13 23:32:16 -04:00
Gnome Ann b1d8797a54 Allow TPU Colab to load sharded HF models 2022-05-12 23:51:40 -04:00
Gnome Ann 4fa5f1cd6a Add TPU support for OPT-350M
The 350M model seems to have a different structure than the other ones ???
2022-05-12 22:21:15 -04:00
Gnome Ann f5e689a725 Upload maps/opt.json and update requirements 2022-05-12 19:09:31 -04:00
Gnome Ann b97b2a02d6 Add `--revision` command line flag 2022-05-10 22:14:56 -04:00
Gnome Ann c117bfd0ad Fix lazy loader 2022-04-08 19:38:15 -04:00
Gnome Ann fabbdf2bb1 Lazy loader Python 3.6 compatibility
The current lazy loader relies on a feature of the Python zipfile module
that was added in Python 3.7.0:

https://bugs.python.org/issue22908

This commit adds compatibility for Python 3.6.
2022-04-02 15:02:54 -04:00
Gnome Ann 67e28d2b5c Typical sampling needs to use nansum instead of sum
If `probs` is zero then `log_probs` will be negative infinity, and the
calculation of `neg_entropy` would then give NaN because zero times
infinity is a mathematically indeterminate value.

We need to use nansum so that those NaN values are treated as zeros to
ignore them in the entropy calculation.
2022-03-28 00:02:31 -04:00
Gnome Ann d5989d4c62 Hide division by zero warning in JAX typical filter
This warning happens when `np.log` gets an input containing zeros.
In that case, NumPy will throw a warning and output negative infinity.

Negative infinity is the correct behaviour here, so we can safely ignore
the warning.
2022-03-27 16:57:12 -04:00
Gnome Ann 20e48b11d7 Typical sampling 2022-03-27 16:25:50 -04:00
Gnome Ann 73aecc0510 Divide NeoX replicated bias layers by 4 again instead of by 8 2022-03-20 01:04:55 -04:00
Gnome Ann 05fc46b253 Changing this again to divide by 8 2022-03-19 02:09:41 -04:00