> For the complete documentation index, see [llms.txt](https://docs.crunchdao.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.crunchdao.com/competitions/participate/resources-limit.md).

# Resources Limit

## Submissions

You can only submit during the [Submission Phase](/other/glossary.md#submission-phase).

You can only submit up to 5 times per day. Some competition may allow more. You can see your current submission for the day at the bottom left.

A submission cannot exceed 5GB and his `resources/` directory cannot exceed 10GB.

{% hint style="info" %}
We can **exceptionally** allow you more as we understand that debugging why your code works locally but not in the cloud environment can be very difficult.

For this, [please contact us on Discord](/competitions/faqs/contact-us.md#help-with-the-hub-competition).
{% endhint %}

## Models

Also known as the `resources/` directory, it allows you to carry state information over multiple runs, provided the total size is under 10 GB.

There is no limit on the number of files themselves, but if we detect abuse, we may introduce one that could break existing models.

All types of file are permitted, including but not limited to:

* persisted models (.joblib),
* model weights (.pkl),
* configuration files,
* ...

Compared to including them in your submission, those files can be modified and persisted across multiple runs.

## Runs

For a run to be considered valid, it must:

* not crash due to a bug in your code or because you have run out of RAM/disk space,
* complete the work under the time constraints,
* produce a prediction.

Predictions are checked once the run is over. However, if a prediction is deemed invalid, the run itself will not be invalidated.

### **Resources**

You can view the runtime specifications before creating a run:

<figure><img src="/files/GyXgYeXXgxQXNyfeArOL" alt=""><figcaption><p>Runtime option selector on the Run creation page.</p></figcaption></figure>

{% hint style="info" %}
The "Authorized Quota" is global; it is not allocated to each individual runtime.

Some consume the quota faster, some slower, but almost always at the normal speed. This rate is based on how much they cost and how powerful they are.
{% endhint %}

#### Providers

We are using multiple compute provider under the hood:

<table><thead><tr><th width="163.75457763671875">Name</th><th width="179.6640625">Runtime Type</th><th>Context</th></tr></thead><tbody><tr><td><a href="https://aws.amazon.com/fargate/">AWS Fargate</a></td><td>CPU</td><td>General computing.</td></tr><tr><td><a href="https://aws.amazon.com/batch/">AWS Batch</a></td><td>GPU</td><td>General computing.</td></tr><tr><td><a href="https://opengpu.network/">OpenGPU</a></td><td>GPU</td><td>Powerful GPUs.</td></tr><tr><td><a href="https://cloud.google.com/batch?hl=en">GCP Batch</a></td><td>CPU + GPU</td><td>General computing.</td></tr></tbody></table>

Using one provider instead of another should not affect your code as we make sure to always provide the same driver versions. If you think there is a bug, please [contact us on Discord](/competitions/faqs/contact-us.md#help-with-the-hub-competition).

#### Networking

Access to the internet in a cloud environment is not permitted. This is achieved by [only allowing local connections](https://linux.die.net/man/7/unix#:~:text=The%20AF_UNIX%20\(also%20known%20as,as%20being%20of%20type%20socket\).), which allows your favorite parallelization libraries to still take advantage of it.

### Quota

The allocated quota are different per competition, you should the overview section to know how much is granted to every participants.

You can also visualize your quota usage under the **Submissions & Runs** tab.

Failed runs are only taken into account when computing the quota at a discounted rate:

* Runs that reach a timeout will count for 5% of their duration.
* Runs that are terminated will count for 5% of their duration.
* All other crashes will count for 30% of their duration.

#### Resets

The quota resets every week during the [Submission Phase](/other/glossary.md#submission-phase).

It only resets once at the beginning of the [Out-of-Sample Phase](/other/glossary.md#out-of-sample-phase). Most competitions are unaffected by this, as they run the models on the entire dataset at once. However, some competitions run models on small sections of the dataset over several weeks.

#### Extras

Whenever you create a run, the timeout is set 30 minutes after your quota.

This allows you to still have a chance of completing the run if you only have a few minutes left.

This also covers the time necessary to set up the environment, such as downloading the data and installing the libraries. This is valuable time during which your model is not running, but which is necessary for the system.

But those minutes do not count towards your quota! If you exceed your quota -for example, if you use 15 hours and 30 seconds but your quota is 15 hours- you will not be able to create a new run.

### Security

Your model runs with the lowest possible level of privilege.

Most of the time, the data is fed directly to your function as an argument, as some pre-processing operations (such as filtering) are sometimes needed.

Any users attempting to bypass the restriction mechanism will be **disqualified**!

### `crunch.load_notebook()`

Using `crunch.load_notebook()` in the cloud environment isn't supported and might raise an error in the future.

CLI users accidentally use it when trying to convert notebooks into regular Python script files. For these users, two alternatives are offered:

1. Use the dedicated `crunch test` command, which performs the testing command automatically, eliminating the need to write code.
2. Use a dedicated script. By creating a file named [`local_test.py`](#user-content-fn-1)[^1], you can import the necessary functions and run the testing function yourself. It also allows for automated pipelines to manipulate the output for additional checks (if desired).

{% code title="local\_test.py" expandable="true" %}

```python
import crunch

from main import train
from main import infer

crunch_tools = crunch.load_notebook()
crunch_tools.test()

...  #  read the prediction, do post-run analyses, ... 
```

{% endcode %}

{% hint style="info" %}
Only competitions in the old format (like DataCrunch's, ADIA Lab's, or EWSC at Broad Institute's) are compatible.

For competitions that require Web3 (such as Synth or Numinous), please read their respective documentation. As an adapted code of the second method will work.
{% endhint %}

## Predictions

Your prediction must not exceed a certain size. This limit varies depending on the competition, but is usually large enough to accommodate everyone.

However, when participants are responsible for writing the prediction files themselves, they must also ensure that they name their files properly and use the correct flags to persist them in the correct format. The most common mistake is including the default `pandas.DataFrame` index when [saving a CSV file](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html#:~:text=indexbool%2C%20default%20True).

Participants cannot download prediction files. If a check fails, the error message should include enough details to help you debug the situation (extra or missing columns, `NaN` or infinite values, ...). If you need further assistance, please, [contact us on Discord](/competitions/faqs/contact-us.md#help-with-the-hub-competition).

[^1]: The file name does not matter.
