Repository: mlcommons/inference
Issue: R-GAT reference implementation is giving the below warning related to numpy array being non-writable. 
Root cause: Validation Gap

Not sure if it is due to the below error, but the run sometimes crashes and a rerun often needs to reinstall numpy to get it working.

```
Run Directory: /root/CM/repos/local/cache/8f67e2eb8e3d4409/inference/graph/R-GAT

CMD: /root/venv/cm/bin/python3 main.py  --scenario Offline --dataset-path /cm-mount/data/common/anandhu/igbh --device gpu   --max-batchsize 2048 --threads 2 --user_conf '/root/CM/repos/mlcommons@mlperf-automations/script/generate-mlperf-inference-user-conf/tmp/9e4884b9fe064663817c1f1ed0eaa346.conf' --audit '/root/CM/repos/local/cache/8f67e2eb8e3d4409/inference/compliance/nvidia/TEST01/rgat/audit.config' --dataset igbh-dgl --profile rgat-dgl-full  --output /root/CM/repos/local/cache/5ed0323894354e50/valid_results/08b6b4b9110d-reference-gpu-pytorch-v2.4.0-cu124/rgat/offline/TEST01 --dtype fp32 --model-path /root/CM/repos/local/cache/26842ad3f07d429f/RGAT/RGAT.pt 2>&1 | tee '/root/CM/repos/local/cache/5ed0323894354e50/valid_results/08b6b4b9110d-reference-gpu-pytorch-v2.4.0-cu124/rgat/offline/TEST01/console.out'; echo \${PIPESTATUS[0]} > exitstatus

INFO:root:         ! cd /root/CM/repos/local/cache/8f67e2eb8e3d4409/inference/loadgen
INFO:root:         ! call /root/CM/repos/mlcommons@mlperf-automations/script/benchmark-program/run-ubuntu.sh from tmp-run.sh

/root/venv/cm/bin/python3 main.py  --scenario Offline --dataset-path /cm-mount/data/common/anandhu/igbh --device gpu   --max-batchsize 2048 --threads 2 --user_conf '/root/CM/repos/mlcommons@mlperf-automations/script/generate-mlperf-inference-user-conf/tmp/9e4884b9fe064663817c1f1ed0eaa346.conf' --audit '/root/CM/repos/local/cache/8f67e2eb8e3d4409/inference/compliance/nvidia/TEST01/rgat/audit.config' --dataset igbh-dgl --profile rgat-dgl-full  --output /root/CM/repos/local/cache/5ed0323894354e50/valid_results/08b6b4b9110d-reference-gpu-pytorch-v2.4.0-cu124/rgat/offline/TEST01 --dtype fp32 --model-path /root/CM/repos/local/cache/26842ad3f07d429f/RGAT/RGAT.pt 2>&1 | tee '/root/CM/repos/local/cache/5ed0323894354e50/valid_results/08b6b4b9110d-reference-gpu-pytorch-v2.4.0-cu124/rgat/offline/TEST01/console.out'; echo ${PIPESTATUS[0]} > exitstatus
INFO:main:Namespace(dataset='igbh-dgl', dataset_path='/cm-mount/data/common/anandhu/igbh', in_memory=False, layout='COO', profile='rgat-dgl-full', scenario='Offline', max_batchsize=2048, threads=2, accuracy=False, find_peak_performance=False, backend='dgl', model_name='rgat', output='/root/CM/repos/local/cache/5ed0323894354e50/valid_results/08b6b4b9110d-reference-gpu-pytorch-v2.4.0-cu124/rgat/offline/TEST01', qps=None, model_path='/root/CM/repos/local/cache/26842ad3f07d429f/RGAT/RGAT.pt', dtype='fp32', device='gpu', user_conf='/root/CM/repos/mlcommons@mlperf-automations/script/generate-mlperf-inference-user-conf/tmp/9e4884b9fe064663817c1f1ed0eaa346.conf', audit_conf='/root/CM/repos/local/cache/8f67e2eb8e3d4409/inference/compliance/nvidia/TEST01/rgat/audit.config', time=None, count=None, debug=False, performance_sample_count=5000, max_latency=None, samples_per_query=8)
/root/CM/repos/local/cache/8f67e2eb8e3d4409/inference/graph/R-GAT/dgl_utilities/feature_fetching.py:231: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)
  return edge, torch.from_numpy(
/root/CM/repos/local/cache/8f67e2eb8e3d4409/inference/graph/R-GAT/dgl_utilities/feature_fetching.py:312: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  torch.load(
/root/CM/repos/local/cache/8f67e2eb8e3d4409/inference/graph/R-GAT/dgl_utilities/feature_fetching.py:318: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  torch.load(
```

`performance_sample_count=788379` (full dataset size) is actually causing the crash. `performance_sample_count=788378` works fine. 

@arjunsuresh I was not able to reproduce the crash. Can you post the specs of the machine you used for your run?

@pgmpablo157321 We were running on the [MLC Automation server](https://github.com/mlcommons/mlperf_inference_unofficial_submissions_v5.0/blob/main/open/MLCommons/systems/08b6b4b9110d-reference-gpu-pytorch-v2.4.0-cu124.json). But since you got it running without issues, the problem could be the different environment we tried on - can you please share the `mlperf_log_detail.txt` and `mlperf_log_summary.txt` to my email so that we can share those as examples of the working reference run?

@arjunsuresh I was able to reproduce the crash. It seems loadgen was going into an edge case and generating a LOT of queries. It was fortunately a quick fix. #2031 

I am not sure why I didn't get the crash before, but it might be that I was running in accuracy mode.

Could you check if this fixes your workflow?