Skip to content
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

Thrift error when running make serve #60

Closed
anishpdoshi opened this issue Feb 15, 2022 · 3 comments
Closed

Thrift error when running make serve #60

anishpdoshi opened this issue Feb 15, 2022 · 3 comments
Labels
question Further information is requested

Comments

@anishpdoshi
Copy link

Hello, when running make serve after cloning Picard, I am hitting a thrift.py3.exceptions.TransportError:

I am running this on an arm64 architecture (MacBook M1), could that be why? I have confirmed nothing else is listening on port 8000.

docker pull tscholak/text-to-sql-eval:5ff827fa65c719ff975a37bd1d6940214731f3f5
5ff827fa65c719ff975a37bd1d6940214731f3f5: Pulling from tscholak/text-to-sql-eval
Digest: sha256:8efe93cb37a75812d4906c11c8d2902eebb125a0023ce8a93b099af3186f8c0e
Status: Image is up to date for tscholak/text-to-sql-eval:5ff827fa65c719ff975a37bd1d6940214731f3f5
docker.io/tscholak/text-to-sql-eval:5ff827fa65c719ff975a37bd1d6940214731f3f5
mkdir -p -m 777 database
mkdir -p -m 777 transformers_cache
docker run \
		-it \
		--rm \
		--user 13011:13011 \
		-p 8000:8000 \
		--mount type=bind,source=/Users/apdoshi/picard/database,target=/database \
		--mount type=bind,source=/Users/apdoshi/picard/transformers_cache,target=/transformers_cache \
		--mount type=bind,source=/Users/apdoshi/picard/configs,target=/app/configs \
		tscholak/text-to-sql-eval:5ff827fa65c719ff975a37bd1d6940214731f3f5 \
		/bin/bash -c "python seq2seq/serve_seq2seq.py configs/serve.json"
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Traceback (most recent call last):
  File "seq2seq/serve_seq2seq.py", line 146, in <module>
    main()
  File "seq2seq/serve_seq2seq.py", line 97, in main
    model = model_cls_wrapper(AutoModelForSeq2SeqLM).from_pretrained(
  File "seq2seq/serve_seq2seq.py", line 91, in <lambda>
    model_cls=model_cls, picard_args=picard_args, tokenizer=tokenizer
  File "/app/seq2seq/utils/picard_model_wrapper.py", line 198, in with_picard
    asyncio.run(_init_picard(), debug=False)
  File "/opt/conda/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/opt/conda/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "/app/seq2seq/utils/picard_model_wrapper.py", line 127, in _init_picard
    await _register_tokenizer(picard_client=client)
  File "/app/seq2seq/utils/picard_model_wrapper.py", line 145, in _register_tokenizer
    await picard_client.registerTokenizer(json_str)
thrift.py3.exceptions.TransportError: (<TransportErrorType.UNKNOWN: 0>, 'Channel is !good()', 0, <TransportOptions.0: 0>)
make: *** [serve] Error 1
@tscholak
Copy link
Collaborator

Hi @anishpdoshi!
It could be caused by a platform mismatch between amd64 and arm, yes. I don't know what is supposed to happen in this case. Is Apple's rosetta emulator supposed to make amd64 programs and docker images run on M1?

@tscholak tscholak added the question Further information is requested label Feb 15, 2022
@anishpdoshi
Copy link
Author

Thanks @tscholak for the quick response. I am not sure if it is linked to Rosetta (I'm on MacOS Monterey), but since it seems to be originate from the registerTokenizer call, I suspect it is related to these issues where the 'tokenizers' library isn't building properly on Apple Silicon:

huggingface/tokenizers#712
treygrainger/ai-powered-search#48

Maybe there's a way around this by building the docker image with --platform linux/arm64? Anyway I'm just going to use a different environment for now, feel free to close this issue if you'd like.

@tscholak
Copy link
Collaborator

tscholak commented Mar 8, 2022

not sure what I can do here to help. arm64 is just not supported.

@tscholak tscholak closed this as completed Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants