Open sidravi1 opened 6 months ago
Can you provide all the results of conda/pip list
?
Sure!
Package Version Editable project location
------------------------- ------------------- -------------------------------------------------
accelerate 0.25.0
aiohttp 3.9.1
aiosignal 1.3.1
annotated-types 0.6.0
anyio 4.2.0
asttokens 2.4.1
async-timeout 4.0.3
attrs 23.1.0
beartype 0.15.0
Brotli 1.1.0
certifi 2023.11.17
cffi 1.16.0
cfgv 3.3.1
chardet 5.2.0
charset-normalizer 3.3.2
cloudpickle 3.0.0
colorama 0.4.6
coverage 7.4.0
datasets 2.16.0
diff_cover 8.0.2
dill 0.3.7
distlib 0.3.8
distro 1.9.0
exceptiongroup 1.2.0
filelock 3.13.1
frozenlist 1.4.1
fsspec 2023.10.0
h11 0.14.0
httpcore 1.0.2
httpx 0.26.0
huggingface-hub 0.20.0
icontract 2.6.6
identify 2.5.33
idna 3.6
importlib-metadata 7.0.1
importlib-resources 6.1.1
iniconfig 2.0.0
interegular 0.3.2
Jinja2 3.1.2
joblib 1.3.2
jsonschema 4.20.0
jsonschema-specifications 2023.11.2
lark 1.1.8
llvmlite 0.41.1
MarkupSafe 2.1.3
mpmath 1.3.0
msgpack 1.0.4
multidict 6.0.4
multiprocess 0.70.15
nest-asyncio 1.5.8
networkx 3.2.1
nodeenv 1.8.0
numba 0.58.1
numpy 1.26.2
openai 1.6.1
outlines 0.1.dev413+g298a080 /Users/sid.ravinutala/Documents/Projects/outlines
packaging 23.2
pandas 2.1.4
perscache 0.6.1
pip 23.3.2
pkgutil_resolve_name 1.3.10
platformdirs 4.1.0
pluggy 1.3.0
pre-commit 3.6.0
psutil 5.9.7
pyarrow 14.0.2
pyarrow-hotfix 0.6
pycparser 2.21
pydantic 2.5.3
pydantic_core 2.14.6
Pygments 2.17.2
PySocks 1.7.1
pytest 7.4.3
pytest-cov 4.1.0
python-dateutil 2.8.2
pytz 2023.3.post1
PyYAML 6.0.1
referencing 0.32.0
regex 2023.12.25
requests 2.31.0
responses 0.24.1
rpds-py 0.15.2
safetensors 0.3.3
SciPy 1.11.4
setuptools 68.2.2
six 1.16.0
sniffio 1.3.0
sympy 1.12
tiktoken 0.5.2
tokenizers 0.15.0
tomli 2.0.1
torch 2.1.2
tqdm 4.66.1
transformers 4.36.2
typing_extensions 4.9.0
tzdata 2023.3
ukkonen 1.0.1
urllib3 2.1.0
virtualenv 20.25.0
wheel 0.42.0
xxhash 3.4.1
yarl 1.9.3
zipp 3.17.0
(outlines-dev)
We managed to reproduce the error internally and will hopefully soon come up with a fix.
Immediately prior to the tests failure, in the call
output = self.model(
input_ids,
attention_mask=attention_mask,
return_dict=True,
output_attentions=False,
output_hidden_states=False,
past_key_values=past_key_values,
)
past_key_values
is a tuple of 5, each being a tensor of shape torch.Size([1, 4, 512, 8])
.
The 512
dimension increments by 1 each call.
The model is limited to 512 tokens https://huggingface.co/hf-internal-testing/tiny-random-GPTJForCausalLM/blob/main/config.json#L23
It's probably failing locally, but passing in CI because of https://pytorch.org/docs/stable/notes/randomness.html#reproducibility
The token count extending beyond n_positions
ungracefully resulting in a torch RuntimeError is also problem which should be addressed.
This is caused by RNGs being inconsistent across machines and the use of a randomly initialized model (https://huggingface.co/hf-internal-testing/tiny-random-GPTJForCausalLM). The eos token is never generated and we exceed the 512 token limit for the model.
I ran into this issue again when working on https://github.com/outlines-dev/outlines/pull/966 and I'll include a fix in that PR. We must ensure that either the greedy
sampler is used, or max_tokens
is specified in tests because we cannot rely on consistent RNGs.
Describe the issue as clearly as possible:
I created a new environment as per this page. And ran pytest to make sure it was all setup correctly. Two tests fail
Steps/code to reproduce the bug:
Setup environment as per this page.
Then run:
Expected result:
No tests fail
Error message:
Test multinomial
Test Integration Transfomers
Outlines/Python version information:
Context for the issue:
Hoping to setup my local environment so I can contribute to the project :)