Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
09d373d
Update deps
iperks Feb 23, 2026
a8c176c
Prefer more recent versions of elixir
iperks Feb 23, 2026
33003d0
Update docs
iperks Feb 23, 2026
80b5f97
Add CI and dependabot GH actions
iperks Feb 23, 2026
3d8ec89
Install Hex and rebar in CI
iperks Feb 23, 2026
70b9f65
Bump xgboost to 3.1.3 (from 3.0.5)
iperks Feb 23, 2026
8056642
Fix ArrayInterface interface
iperks Feb 23, 2026
1cdcde2
Extend tests
iperks Feb 23, 2026
cbe7fde
Add ability to check one version against another for breaking changes
iperks Feb 24, 2026
4372e1c
Add 2 new exg_free functions; we'll use later to reduce duplication
iperks Feb 24, 2026
ecbde3a
Ensure allocated memory is freed appropriately
iperks Feb 24, 2026
db5b1e9
Avoid leaking local, xgboost owns the array, beam owns the created term
iperks Feb 24, 2026
bdc5f23
Use helper to free boosters that were created but left dangling
iperks Feb 24, 2026
5072471
Free things that we enif_alloc'd
iperks Feb 24, 2026
cdea402
Fix config pointer
iperks Feb 24, 2026
5c586f1
Fix compile warnings, use correct pointer types
iperks Feb 24, 2026
aaff90f
Fix elixir formatting
iperks Feb 24, 2026
cb807c6
Remove elixir 1.17 from CI
iperks Feb 24, 2026
4e21cd4
Add commentary on memory usage
iperks Feb 24, 2026
1712651
Bump to 0.6.0
iperks Feb 24, 2026
d96ceb8
Handle charlists in unwrap!
iperks Feb 24, 2026
5914c13
Fallback when loading models
iperks Feb 24, 2026
912065c
Fix makefile
iperks Feb 24, 2026
fc1ad14
Revert "Fix makefile"
iperks Feb 24, 2026
39c8456
Try to fix makefile again
iperks Feb 24, 2026
edefe90
Release build when right MIX_ENV passed
iperks Feb 24, 2026
d831c2d
Nif elixir needs to match interface
iperks Feb 24, 2026
77580d2
Add missing typespecs
iperks Feb 24, 2026
178deec
Fix spec
iperks Feb 24, 2026
30a6b8e
Add dialyzer
iperks Feb 24, 2026
ecc3e39
Formatting pass
iperks Feb 24, 2026
7e79f79
Remove double set of MIX_ENV in Makefile
iperks Feb 24, 2026
756b15f
Update lib/exgboost/array_interface.ex
iperks Feb 24, 2026
1faae1c
Merge pull request #1 from iperks/ip/updates
iperks Feb 24, 2026
0250ad4
Fix typespec
iperks Feb 24, 2026
80440b8
Bump to 0.6.1
iperks Feb 25, 2026
ccdd4e6
Add README note about thread safety
iperks Feb 25, 2026
6ad3e31
Remove duplicate assertion
iperks Jul 1, 2026
87c989e
Deps upgrade
iperks Jul 1, 2026
e92e57a
Implement devcontainer for more isolated builds
iperks Jul 1, 2026
41aca8c
Update GH workflows
iperks Jul 1, 2026
e1e086b
Point to my github repo
iperks Jul 1, 2026
d2d3779
Fix minor issues in makefile
iperks Jul 1, 2026
5b36911
Fix for stricter C++ compile warnings
iperks Jul 1, 2026
874c663
Bump to 0.7.0
iperks Jul 1, 2026
7918421
Setup and install asdf runner in osx
iperks Jul 1, 2026
d95880e
Prevent nodejs warnings
iperks Jul 1, 2026
ff098eb
Use beam setup rather than asdf
iperks Jul 1, 2026
daa5b1b
Update precompile matrix for macos
iperks Jul 1, 2026
a30b175
Upgrade to elixir 1.20.2 plus other updates
iperks Jul 1, 2026
c6d74f5
Bump to 0.8.0
iperks Jul 1, 2026
b1b7154
Revert upgrade to httpoison
iperks Jul 1, 2026
bf9a5ed
Bump 0.8.1
iperks Jul 1, 2026
dea9360
Update elixir_make dependency
iperks Jul 6, 2026
d135d08
Update ex_doc dependency
iperks Jul 6, 2026
8f648be
Update ex_json_schema dependency
iperks Jul 6, 2026
cca04da
Replace httpoison with req
iperks Jul 6, 2026
cda4b83
Update kino
iperks Jul 6, 2026
d19726a
Update jason dependency
iperks Jul 6, 2026
ee059ac
Use underlying erlang httpc library
iperks Jul 6, 2026
91edcf5
ex_json_schema upgrade
iperks Jul 6, 2026
1e56709
Update nx and related deps
iperks Jul 6, 2026
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
46 changes: 46 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM hexpm/elixir:1.20.2-erlang-29.0.2-debian-trixie-20260623-slim

ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV CC=gcc-14
ENV CXX=g++-14

RUN apt-get update && \
apt-get dist-upgrade --yes && \
apt-get install --yes --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
g++-14 \
gcc-14 \
git \
inotify-tools \
ninja-build \
openssh-client \
pkg-config \
python3 \
python3-venv \
sudo \
zsh && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 140 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 140 && \
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 140 && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-14 140 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN useradd -m -s /bin/zsh -u 1000 -G sudo dev && \
echo 'dev ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/dev && \
chmod 0440 /etc/sudoers.d/dev && \
mkdir -p /workspace && \
chown dev:dev /workspace

USER dev

RUN git config --global --add safe.directory /workspace && \
mix local.hex --force && \
mix local.rebar --force

WORKDIR /workspace
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"version": "2.5.9",
"resolved": "ghcr.io/devcontainers/features/common-utils@sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a",
"integrity": "sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a"
},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"version": "1.10.0",
"resolved": "ghcr.io/devcontainers/features/docker-outside-of-docker@sha256:c2c2cf829505ead8e4892c88c31b6594ae94a2bbb209e16e1fac456c1a3a624e",
"integrity": "sha256:c2c2cf829505ead8e4892c88c31b6594ae94a2bbb209e16e1fac456c1a3a624e"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "1.3.7",
"resolved": "ghcr.io/devcontainers/features/git@sha256:a3e43ff91b9f5f6bd2c14bd510d43e5e698f1266dc41027ba4e04e7e45be607a",
"integrity": "sha256:a3e43ff91b9f5f6bd2c14bd510d43e5e698f1266dc41027ba4e04e7e45be607a"
},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "1.1.0",
"resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671",
"integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671"
}
}
}
33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "EXGBoost Erlang 29 GCC 14",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"workspaceFolder": "/workspace",
"containerEnv": {
"CC": "gcc-14",
"CXX": "g++-14",
"MIX_ENV": "dev"
},
"customizations": {
"vscode": {
"extensions": [
"jakebecker.elixir-ls"
]
}
},
"postCreateCommand": "mix deps.get",
"remoteUser": "dev",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"configureZshAsDefaultShell": true
},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": false
}
}
}
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "mix"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: ci

on:
pull_request:
push:
branches:
- main

jobs:
test:
name: Test OTP ${{ matrix.otp }} / Elixir ${{ matrix.elixir }}
runs-on: ubuntu-24.04
env:
CC: gcc-14
CXX: g++-14
MIX_ENV: test
strategy:
fail-fast: false
matrix:
include:
- otp: "28.3"
elixir: "1.18.4"
- otp: "28.3"
elixir: "1.19.5"
- otp: "29.0.2"
elixir: "1.20.2"

steps:
- uses: actions/checkout@v5

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build gcc-14 g++-14

- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}

- name: Install Hex and Rebar
run: |
mix local.hex --force
mix local.rebar --force

- name: Install dependencies
run: mix deps.get

- name: Check formatting
run: mix format --check-formatted

- name: Run tests
run: MIX_ENV=test mix test
41 changes: 22 additions & 19 deletions .github/workflows/precompile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,32 @@ jobs:
runs-on: ubuntu-24.04
env:
MIX_ENV: "prod"
CC: gcc-14
CXX: g++-14
strategy:
matrix:
otp: ["27.0", "28.0"]
elixir: ["1.18.4"]
include:
- otp: "28.3"
elixir: "1.18.4"
- otp: "28.3"
elixir: "1.19.5"
- otp: "29.0.2"
elixir: "1.20.2"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Install system dependecies
- name: Install Hex and Rebar
run: |
mix local.hex --force
mix local.rebar --force
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential automake autoconf pkg-config bc m4 unzip zip \
cmake ninja-build gcc-14 g++-14 \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
- name: Mix Test
Expand All @@ -42,25 +54,16 @@ jobs:
cache/*.tar.gz

macos:
runs-on: ${{matrix.runner}}
# Homebrew supports versioned Erlang/OTP but not Elixir
# It's a deliberate design decision from Homebrew to
# only support versioned distributions for certain packages
name: Mac (ARM) Erlang/OTP ${{matrix.otp}} / Elixir
runs-on: macos-15
name: Mac (ARM) Erlang/OTP 29.0.2 / Elixir 1.20.2
env:
MIX_ENV: "prod"
strategy:
matrix:
runner: ["macos-15"]
otp: ["27.0", "28.0"]
elixir: ["1.18.4"]
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- uses: actions/checkout@v5
- uses: erlef/setup-beam@v1
with:
tool_versions: |
erlang ${{matrix.otp}}
elixir ${{matrix.elixir}}
otp-version: "29.0.2"
elixir-version: "1.20.2"
- name: Install libomp
run: |
brew install libomp
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ erl_crash.dump
*.beam
/config/*.secret.exs
.elixir_ls/
.tool-versions
.vscode/
checksum.exs
.DS_Store
45 changes: 38 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
# Environment variables passed via elixir_make
# ERTS_INCLUDE_DIR
# MIX_APP_PATH
# MIX_ENV

TEMP ?= $(HOME)/.cache
MIX_ENV ?= dev
XGBOOST_CACHE ?= $(TEMP)/exgboost
XGBOOST_GIT_REPO ?= https://github.com/dmlc/xgboost.git
# v3.0.5 tagged release
XGBOOST_GIT_REV ?= v3.0.5
# v3.1.3 tagged release
XGBOOST_GIT_REV ?= v3.1.3
OLD_XGBOOST_GIT_REV ?= v3.0.5
NEW_XGBOOST_GIT_REV ?= $(XGBOOST_GIT_REV)
XGBOOST_NS = xgboost-$(XGBOOST_GIT_REV)
XGBOOST_DIR = $(XGBOOST_CACHE)/$(XGBOOST_NS)
XGBOOST_LIB_DIR = $(XGBOOST_DIR)/build/xgboost
XGBOOST_LIB_DIR_FLAG = $(XGBOOST_LIB_DIR)/exgboost.ok

# Set build type based on MIX_ENV
ifeq ($(MIX_ENV), prod)
CMAKE_BUILD_TYPE = Release
else
CMAKE_BUILD_TYPE = RelWithDebInfo
endif

# Private configuration
PRIV_DIR = $(MIX_APP_PATH)/priv
EXGBOOST_DIR = $(realpath c/exgboost)
Expand Down Expand Up @@ -43,21 +54,21 @@ else
endif

$(EXGBOOST_SO): $(EXGBOOST_CACHE_SO)
@ mkdir -p $(PRIV_DIR)
@mkdir -p $(PRIV_DIR)
cp -a $(abspath $(EXGBOOST_CACHE_LIB_DIR)) $(EXGBOOST_LIB_DIR) ; \
cp -a $(abspath $(EXGBOOST_CACHE_SO)) $(EXGBOOST_SO) ;

$(EXGBOOST_CACHE_SO): $(XGBOOST_LIB_DIR_FLAG) $(C_SRCS)
@mkdir -p cache
cp -a $(XGBOOST_LIB_DIR) $(EXGBOOST_CACHE_LIB_DIR)
mv $(XGBOOST_LIB_DIR)/lib/$(LIBXGBOOST) $(EXGBOOST_CACHE_LIB_DIR)
cp -R $(XGBOOST_LIB_DIR) $(EXGBOOST_CACHE_LIB_DIR)
cp $(XGBOOST_DIR)/lib/$(LIBXGBOOST) $(EXGBOOST_CACHE_LIB_DIR)
$(CC) $(CFLAGS) $(wildcard $(EXGBOOST_DIR)/src/*.c) $(LDFLAGS) -o $(EXGBOOST_CACHE_SO)
$(POST_INSTALL)

# This new target handles fetching the source code.
# It only runs if the .git directory inside the source folder is missing.
$(XGBOOST_DIR)/.git:
mkdir -p $(XGBOOST_DIR) && \
@mkdir -p $(XGBOOST_DIR) && \
cd $(XGBOOST_DIR) && \
git init && \
git remote add origin $(XGBOOST_GIT_REPO) && \
Expand All @@ -69,10 +80,30 @@ $(XGBOOST_DIR)/.git:
# It only contains the build commands.
$(XGBOOST_LIB_DIR_FLAG): $(XGBOOST_DIR)/.git
cd $(XGBOOST_DIR) && \
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$(XGBOOST_LIB_DIR) -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja $(CMAKE_FLAGS) && \
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$(XGBOOST_LIB_DIR) -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -GNinja $(CMAKE_FLAGS) && \
ninja -C build install
touch $(XGBOOST_LIB_DIR_FLAG)

check-xgboost-c-api: $(XGBOOST_LIB_DIR_FLAG)
./scripts/check_xgboost_c_api.sh "$(XGBOOST_LIB_DIR)/include"

compare-xgboost-c-api:
@set -eu; \
for rev in "$(OLD_XGBOOST_GIT_REV)" "$(NEW_XGBOOST_GIT_REV)"; do \
dir="$(XGBOOST_CACHE)/xgboost-$$rev"; \
mkdir -p "$$dir"; \
if [ ! -d "$$dir/.git" ]; then \
git -C "$$dir" init; \
git -C "$$dir" remote add origin "$(XGBOOST_GIT_REPO)"; \
fi; \
git -C "$$dir" fetch --depth 1 --recurse-submodules origin "$$rev"; \
git -C "$$dir" checkout -f FETCH_HEAD; \
git -C "$$dir" submodule update --init --recursive; \
done; \
./scripts/check_xgboost_c_api.sh --compare \
"$(XGBOOST_CACHE)/xgboost-$(OLD_XGBOOST_GIT_REV)/include" \
"$(XGBOOST_CACHE)/xgboost-$(NEW_XGBOOST_GIT_REV)/include"

clean:
rm -rf $(EXGBOOST_CACHE_SO)
rm -rf $(EXGBOOST_CACHE_LIB_DIR)
Expand Down
Loading
Loading