Minor Bug: HF (run_text_classification) attempts to use XLA on CUDA device
A minor inconsistency: on a GPU runtime, when I execute:!pip install -q cloud-tpu-client==0.10 https://storage.googleapis.com/tpu-pytorch/wheels/torch_xla-1.9-cp37-cp37m-linux_x86_64.whlto install the TPU client, HuggingFace will try to use XLA even if a CUDA device is present.RuntimeError: tensorflow/compiler/xla/xla_client/computation_client.cc:273 : Missing XLA configurationShouldn’t there be checks to verify if XLA/TPU cores flag is not passed, it should fall back to CUDA->CPU rather than trying to run via XLA?
2021-07-17T14:10:14Z
Good point, which flags were you thinking of? If you feel up to it, don’t hesitate to open a PR with those changes!
2021-07-17T14:44:37Z
These were the flags in my mind:---xla [XLA]           Whether to activate the XLA compilation or not
--tpu_name TPU_NAME   Name of TPU
--tpu_zone TPU_ZONE   Zone of TPU
--tpu_num_cores TPU_NUM_CORES
                        TPU: Number of TPU cores (automatically passed by
                        launcher script)which indicates TPU/XLA is being used.I don’t think I am ready to open PR’s yetthough I am happy to assist in other ways
2021-07-19T09:24:27Z
Ok, will add it then.