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
2 changes: 1 addition & 1 deletion .github/workflows/virtual-environments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ jobs:
# Run Scikeras Python Package Test
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.ScikerasTest" --blame-hang-timeout 120seconds --blame-crash
# Run Transformers
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.Transformers" --blame-hang-timeout 120seconds --blame-crash
dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests.Transformers|XTransformers" --blame-hang-timeout 120seconds --blame-crash
12 changes: 6 additions & 6 deletions DockerfileLeanFoundation
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ RUN pip install --no-cache-dir \
jupyter-bokeh==3.0.7 \
imbalanced-learn==0.11.0 \
scikeras==0.12.0 \
openai==0.28.1 \
openai[embeddings]==0.28.1 \
openai[wandb]==0.28.1 \
openai==1.3.5 \
lazypredict==0.2.12 \
fracdiff==0.9.0 \
darts==0.24.0 \
Expand All @@ -224,14 +222,16 @@ RUN pip install --no-cache-dir \
tick==0.7.0.1 \
transformers==4.34.0 \
Rbeast==0.1.16 \
langchain==0.0.316 \
langchain==0.0.341 \
tensorflow-ranking==0.5.3 \
pomegranate==1.0.3 \
tigramite==5.2.3.1 \
MAPIE==0.7.0 \
mlforecast==0.9.3 \
functime==0.8.4 \
tensorrt==8.6.1.post1
tensorrt==8.6.1.post1 \
x-transformers==1.26.0 \
Werkzeug==2.3.8

RUN conda install -c conda-forge -y cudatoolkit=11.8.0 && conda install -c nvidia -y cuda-compiler=12.2.2 && conda clean -y --all
ENV XLA_FLAGS=--xla_gpu_cuda_data_dir=/opt/miniconda3/
Expand All @@ -242,7 +242,7 @@ ENV CUDA_MODULE_LOADING=LAZY
RUN dwave install --all -y

# Install 'ipopt' solver for 'Pyomo'
RUN conda install -c conda-forge ipopt==3.14.12 \
RUN conda install -c conda-forge ipopt==3.14.13 \
&& conda clean -y --all

# We install need to install separately else fails to find numpy
Expand Down
12 changes: 6 additions & 6 deletions DockerfileLeanFoundationARM
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ RUN pip install --no-cache-dir \
jupyter-bokeh==3.0.7 \
imbalanced-learn==0.11.0 \
scikeras==0.12.0 \
openai==0.28.1 \
openai[embeddings]==0.28.1 \
openai[wandb]==0.28.1 \
openai==1.3.5 \
lazypredict==0.2.12 \
fracdiff==0.9.0 \
darts==0.24.0 \
Expand All @@ -204,18 +202,20 @@ RUN pip install --no-cache-dir \
Shimmy==1.3.0 \
FixedEffectModel==0.0.5 \
transformers==4.34.0 \
langchain==0.0.316 \
langchain==0.0.341 \
tensorflow-ranking==0.5.3 \
pomegranate==1.0.3 \
tigramite==5.2.3.1 \
MAPIE==0.7.0 \
mlforecast==0.9.3
mlforecast==0.9.3 \
x-transformers==1.26.0 \
Werkzeug==2.3.8

# Install dwave tool
RUN dwave install --all -y

# Install 'ipopt' solver for 'Pyomo'
RUN conda install -c conda-forge ipopt==3.14.12 \
RUN conda install -c conda-forge ipopt==3.14.13 \
&& conda clean -y --all

# We install need to install separately else fails to find numpy
Expand Down
31 changes: 30 additions & 1 deletion Tests/Python/PythonPackagesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,42 @@
using System;
using Python.Runtime;
using NUnit.Framework;
using QuantConnect.Python;

namespace QuantConnect.Tests.Python
{
[TestFixture, Category("TravisExclude")]
public class PythonPackagesTests
{
[Test, Explicit("Needs to be run by itself to avoid hanging")]
public void XTransformers()
{
AssertCode(
@"
import torch
from x_transformers import XTransformer

def RunTest():
model = XTransformer(
dim = 512,
enc_num_tokens = 256,
enc_depth = 6,
enc_heads = 8,
enc_max_seq_len = 1024,
dec_num_tokens = 256,
dec_depth = 6,
dec_heads = 8,
dec_max_seq_len = 1024,
tie_token_emb = True # tie embeddings of encoder and decoder
)

src = torch.randint(0, 256, (1, 1024))
src_mask = torch.ones_like(src).bool()
tgt = torch.randint(0, 256, (1, 1024))

loss = model(src, tgt, mask = src_mask) # (1, 1024, 512)
loss.backward()");
}

[Test]
public void Functime()
{
Expand Down