{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"Dataset: [https://www.kaggle.com/datasets/seshurajup/predict-ai-model-code-dataset](https://www.kaggle.com/datasets/seshurajup/predict-ai-model-code-dataset) from [https://github.com/google-research-datasets/tpu_graphs/tree/main](https://github.com/google-research-datasets/tpu_graphs/tree/main)","metadata":{}},{"cell_type":"code","source":"! cp -r /kaggle/input/predict-ai-model-code-dataset/tpu_graphs /kaggle/working/code","metadata":{"execution":{"iopub.status.busy":"2023-08-30T02:40:11.356422Z","iopub.execute_input":"2023-08-30T02:40:11.356850Z","iopub.status.idle":"2023-08-30T02:40:12.820274Z","shell.execute_reply.started":"2023-08-30T02:40:11.356809Z","shell.execute_reply":"2023-08-30T02:40:12.818927Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%cd /kaggle/working/code","metadata":{"execution":{"iopub.status.busy":"2023-08-30T02:40:12.822868Z","iopub.execute_input":"2023-08-30T02:40:12.823258Z","iopub.status.idle":"2023-08-30T02:40:12.831748Z","shell.execute_reply.started":"2023-08-30T02:40:12.823224Z","shell.execute_reply":"2023-08-30T02:40:12.830462Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! pip -qq install tensorflow_gnn --pre\n! pip -qq install tensorflow-ranking","metadata":{"execution":{"iopub.status.busy":"2023-08-30T02:40:12.833820Z","iopub.execute_input":"2023-08-30T02:40:12.834285Z","iopub.status.idle":"2023-08-30T02:41:08.116972Z","shell.execute_reply.started":"2023-08-30T02:40:12.834244Z","shell.execute_reply":"2023-08-30T02:41:08.115172Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! mkdir -p /root/data/tpugraphs/","metadata":{"execution":{"iopub.status.busy":"2023-08-30T02:42:59.668818Z","iopub.execute_input":"2023-08-30T02:42:59.669297Z","iopub.status.idle":"2023-08-30T02:43:00.778845Z","shell.execute_reply.started":"2023-08-30T02:42:59.669249Z","shell.execute_reply":"2023-08-30T02:43:00.777364Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! ln -s /kaggle/input/predict-ai-model-runtime/npz_all/npz /root/data/tpugraphs/","metadata":{"execution":{"iopub.status.busy":"2023-08-30T02:43:02.501044Z","iopub.execute_input":"2023-08-30T02:43:02.501471Z","iopub.status.idle":"2023-08-30T02:43:03.604555Z","shell.execute_reply.started":"2023-08-30T02:43:02.501438Z","shell.execute_reply":"2023-08-30T02:43:03.603134Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! mkdir -p /root/out/tpugraphs_tiles","metadata":{"execution":{"iopub.status.busy":"2023-08-30T02:43:06.584392Z","iopub.execute_input":"2023-08-30T02:43:06.584868Z","iopub.status.idle":"2023-08-30T02:43:07.687883Z","shell.execute_reply.started":"2023-08-30T02:43:06.584828Z","shell.execute_reply":"2023-08-30T02:43:07.686632Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! ln -s   /root/out/tpugraphs_tiles /kaggle/working/","metadata":{"execution":{"iopub.status.busy":"2023-08-30T02:43:12.637745Z","iopub.execute_input":"2023-08-30T02:43:12.638284Z","iopub.status.idle":"2023-08-30T02:43:13.743931Z","shell.execute_reply.started":"2023-08-30T02:43:12.638238Z","shell.execute_reply":"2023-08-30T02:43:13.742524Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"! python tiles_train.py --model=EarlyJoinSAGE --toy_data=True --out_dir=/kaggle/working/","metadata":{"execution":{"iopub.status.busy":"2023-08-30T02:44:18.968492Z","iopub.execute_input":"2023-08-30T02:44:18.968963Z","iopub.status.idle":"2023-08-30T02:51:54.007460Z","shell.execute_reply.started":"2023-08-30T02:44:18.968926Z","shell.execute_reply":"2023-08-30T02:51:54.006204Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"*As a test*\n> python layout_train.py --epochs 10 --toy_data=True  --out_dir=/kaggle/working/\n\n*On xla:random*\n> python layout_train.py --source xla --search random --epochs 10 --max_configs 1000  --out_dir=/kaggle/working/\n\n*On xla:default*\n> python layout_train.py --source xla --search default --epochs 10 --max_configs 1000 --out_dir=/kaggle/working/\n\n*On nlp:random*\n> python layout_train.py --source nlp --search random --epochs 10 --max_configs 1000 --out_dir=/kaggle/working/\n\n*On nlp:default*\n> python layout_train.py --source nlp --search default --epochs 10 --max_configs 1000 --out_dir=/kaggle/working/\n\n* Merge All csv as submission.csv *","metadata":{}},{"cell_type":"code","source":"! cp /kaggle/working/results_*.csv /kaggle/working/submission.csv","metadata":{"execution":{"iopub.status.busy":"2023-08-30T02:52:32.065070Z","iopub.execute_input":"2023-08-30T02:52:32.065526Z","iopub.status.idle":"2023-08-30T02:52:33.177231Z","shell.execute_reply.started":"2023-08-30T02:52:32.065493Z","shell.execute_reply":"2023-08-30T02:52:33.175598Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\nresult = pd.read_csv(\"/kaggle/working/submission.csv\")\nresult","metadata":{"execution":{"iopub.status.busy":"2023-08-30T02:52:39.218988Z","iopub.execute_input":"2023-08-30T02:52:39.219469Z","iopub.status.idle":"2023-08-30T02:52:39.259951Z","shell.execute_reply.started":"2023-08-30T02:52:39.219433Z","shell.execute_reply":"2023-08-30T02:52:39.258770Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# UpVote dataset & code, if its helpful","metadata":{}}],"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}}