Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ RUN uv pip install --no-build-isolation --system "git+https://github.com/Kaggle/

# b/408281617: Torch is adamant that it can not install cudnn 9.3.x, only 9.1.x, but Tensorflow can only support 9.3.x.
# This conflict causes a number of package downgrades, which are handled in this command
RUN uv pip install --system --force-reinstall --extra-index-url https://pypi.nvidia.com "cuml-cu12==25.2.1" \
RUN uv pip install \
--index-url https://pypi.nvidia.com --extra-index-url https://pypi.org/simple/ --index-strategy unsafe-first-match \
--system --force-reinstall "cuml-cu12==25.2.1" \
"nvidia-cudnn-cu12==9.3.0.75" "nvidia-cublas-cu12==12.5.3.2" "nvidia-cusolver-cu12==11.6.3.83" \
"nvidia-cuda-cupti-cu12==12.5.82" "nvidia-cuda-nvrtc-cu12==12.5.82" "nvidia-cuda-runtime-cu12==12.5.82" \
"nvidia-cufft-cu12==11.2.3.61" "nvidia-curand-cu12==10.3.6.82" "nvidia-cusparse-cu12==12.5.1.3" \
Expand Down Expand Up @@ -171,7 +173,7 @@ ENV PYTHONUSERBASE="/root/.local"
ADD patches/kaggle_gcp.py \
patches/kaggle_secrets.py \
patches/kaggle_session.py \
patches/kaggle_web_client.py \
patches/kaggle_web_client.py \
patches/kaggle_datasets.py \
patches/log.py \
$PACKAGE_PATH/
Expand Down
9 changes: 7 additions & 2 deletions kaggle_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ easyocr
# b/302136621: Fix eli5 import for learntools
eli5
emoji
fastcore>=1.7.20
fastcore
# b/445960030: Requires a newer version of fastai than the currently used base image.
# Remove when relying on a newer base image.
fastai>=2.8.4
fasttext
featuretools
fiona
Expand Down Expand Up @@ -89,7 +92,9 @@ nbconvert==6.4.5
nbdev
nilearn
olefile
onnx
# b/445960030: Broken in 1.19.0. See https://github.com/onnx/onnx/issues/7249.
# Fixed with https://github.com/onnx/onnx/pull/7254. Upgrade when version with fix is published.
onnx==1.18.0
openslide-bin
openslide-python
optuna
Expand Down
59 changes: 30 additions & 29 deletions tests/test_fastai.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
import unittest

import fastai

from fastai.tabular.all import *


class TestFastAI(unittest.TestCase):
# Basic import
def test_basic(self):
import fastai
import fastcore
import fastprogress
import fastdownload

def test_has_version(self):
self.assertGreater(len(fastai.__version__), 2)

# based on https://github.com/fastai/fastai/blob/master/tests/test_torch_core.py#L17
def test_torch_tensor(self):
a = tensor([1, 2, 3])
b = torch.tensor([1, 2, 3])

self.assertTrue(torch.all(a == b))

def test_tabular(self):
dls = TabularDataLoaders.from_csv(
"/input/tests/data/train.csv",
cont_names=["pixel"+str(i) for i in range(784)],
y_names='label',
procs=[FillMissing, Categorify, Normalize])
learn = tabular_learner(dls, layers=[200, 100])
with learn.no_bar():
learn.fit_one_cycle(n_epoch=1)

self.assertGreater(learn.smooth_loss, 0)
# Basic import
def test_basic(self):
import fastai
import fastcore
import fastprogress
import fastdownload

def test_has_version(self):
self.assertGreater(len(fastai.__version__), 2)

# based on https://github.com/fastai/fastai/blob/master/tests/test_torch_core.py#L17
def test_torch_tensor(self):
a = tensor([1, 2, 3])
b = torch.tensor([1, 2, 3])

self.assertTrue(torch.all(a == b))

def test_tabular(self):
dls = TabularDataLoaders.from_csv(
"/input/tests/data/train.csv",
cont_names=["pixel" + str(i) for i in range(784)],
y_names="label",
procs=[FillMissing, Categorify, Normalize],
)
learn = tabular_learner(dls, layers=[200, 100])
with learn.no_bar():
learn.fit_one_cycle(n_epoch=1)

self.assertGreater(learn.smooth_loss, 0)