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

Can I train question-answering on TPU using Huggingface #4784

Closed
thak123 opened this issue Jun 5, 2020 · 4 comments
Closed

Can I train question-answering on TPU using Huggingface #4784

thak123 opened this issue Jun 5, 2020 · 4 comments

Comments

@thak123
Copy link

thak123 commented Jun 5, 2020

❓ Questions & Help

I am trying to run run_squad from question answering on TPU but I get the following error.

Details

export SQUAD_DIR=/path/to/SQUAD
python examples/xla_spawn.py --num_cores 8
run_squad.py
--model_type bert
--model_name_or_path bert-base-uncased
--do_train
--do_eval
--do_lower_case
--train_file $SQUAD_DIR/train-v1.1.json
--predict_file $SQUAD_DIR/dev-v1.1.json
--per_gpu_train_batch_size 12
--learning_rate 3e-5
--num_train_epochs 2.0
--max_seq_length 384
--doc_stride 128
--output_dir /tmp/debug_squad/

run_squad.py: error: unrecognized arguments: --tpu_num_cores 1

@julien-c
Copy link
Member

julien-c commented Jun 5, 2020

as you can see in https://github.com/huggingface/transformers/tree/master/examples#the-big-table-of-tasks question-answering is not implemented using Trainer, yet – so doesn't have TPU support.

This is on our todo-list but might take a few weeks. Feel free to open a PR though – or use TFTrainer is TF is an option

@thak123
Copy link
Author

thak123 commented Jun 5, 2020

I think I can live with TFTrainer ... Thanks for the reply

@thak123 thak123 closed this as completed Jun 5, 2020
@thak123
Copy link
Author

thak123 commented Jun 5, 2020

how do i use TFTrainer with TPU

@LysandreJik
Copy link
Member

Hi! The running on TPU section of the examples covers that.

Basically, if on a correctly setup TPU, the TF trainer will automatically launch on TPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants