Skip to content

Commit

Permalink
fix: got the tests passing for all the demos except 02_unify_code, mm…
Browse files Browse the repository at this point in the history
…pretrain and xgboost
  • Loading branch information
vedpatwardhan committed Nov 3, 2023
1 parent a1c686a commit 4dd0dc9
Show file tree
Hide file tree
Showing 9 changed files with 118,177 additions and 133 deletions.
117,565 changes: 117,565 additions & 0 deletions data/train.csv

Large diffs are not rendered by default.

460 changes: 433 additions & 27 deletions examples_and_demos/resnet_demo.ipynb

Large diffs are not rendered by default.

56 changes: 45 additions & 11 deletions examples_and_demos/torch_to_jax.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {
"id": "nnyOp6JusBLv"
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n",
"\u001b[0m\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n",
"\u001b[0m\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n",
"\u001b[0m"
]
}
],
"source": [
"!pip install -q ivy\n",
"!pip install -q transformers\n",
Expand Down Expand Up @@ -82,11 +93,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {
"id": "Fl2RJ_KlsNy2"
},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-11-02 19:23:15.980130: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n",
"2023-11-02 19:23:15.980177: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n",
"2023-11-02 19:23:15.980207: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",
"2023-11-02 19:23:17.351203: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n"
]
}
],
"source": [
"jax.config.update(\"jax_enable_x64\", False)\n",
"\n",
Expand Down Expand Up @@ -132,15 +154,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "DEBx4fwFvmC-",
"outputId": "ef553432-e143-4248-c674-d0c0a6bf80db"
},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING:root:To preserve the tracer and transpiler caches across multiple machines, ensure that the relative path of your projects from the .ivy folder is consistent across all machines. You can do this by adding .ivy to your home folder and placing all projects in the same place relative to the home folder on all machines.\n",
"WARNING:root:Native Numpy does not support GPU placement, consider using Jax instead\n",
"/workspaces/ivy/ivy/utils/exceptions.py:390: UserWarning: The current backend: 'jax' does not support inplace updates natively. Ivy would quietly create new arrays when using inplace updates with this backend, leading to memory overhead (same applies for views). If you want to control your memory management, consider doing ivy.set_inplace_mode('strict') which should raise an error whenever an inplace update is attempted with this backend.\n",
" warnings.warn(\n"
]
}
],
"source": [
"transpiled_graph = ivy.transpile(model, to=\"haiku\", kwargs=inputs)"
]
Expand Down Expand Up @@ -217,7 +250,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 8,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
Expand All @@ -230,7 +263,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"9.67 ms ± 2.28 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
"6.63 ms ± 122 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
]
}
],
Expand All @@ -241,7 +274,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 9,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
Expand All @@ -254,7 +287,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"4.09 ms ± 9.48 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
"1.18 ms ± 134 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
]
}
],
Expand Down Expand Up @@ -340,7 +373,8 @@
"name": "python3"
},
"language_info": {
"name": "python"
"name": "python",
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 4dd0dc9

Please sign in to comment.