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: 2 additions & 0 deletions kernel-builder/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions kernel-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ serde_json = "1"
serde-value = "0.7"
thiserror = "1"
toml = "0.8"
url = { version = "2", features = ["serde"] }

[build-dependencies]
minijinja-embed = "2.5"
Expand Down
1 change: 1 addition & 0 deletions kernel-builder/src/config/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use serde_value::Value;
use super::{v1, v2, v3, Build};

#[derive(Debug)]
#[allow(clippy::large_enum_variant)]
pub enum BuildCompat {
V1(v1::Build),
V2(v2::Build),
Expand Down
3 changes: 3 additions & 0 deletions kernel-builder/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ pub struct General {
/// Hugging Face Hub license identifier.
pub license: Option<String>,

/// Source repository or reference for the kernel code.
pub upstream: Option<url::Url>,

pub backends: Vec<Backend>,
pub hub: Option<Hub>,
pub python_depends: Option<Vec<String>>,
Expand Down
1 change: 1 addition & 0 deletions kernel-builder/src/config/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ impl TryFrom<Build> for super::Build {
name: build.general.name,
version: None,
license: None,
upstream: None,
backends,
hub: None,
neuron: None,
Expand Down
1 change: 1 addition & 0 deletions kernel-builder/src/config/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ impl General {
name: general.name,
version: None,
license: None,
upstream: None,
backends,
cuda,
hub: general.hub.map(Into::into),
Expand Down
4 changes: 4 additions & 0 deletions kernel-builder/src/config/v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ pub struct General {

pub license: Option<String>,

pub upstream: Option<url::Url>,

pub backends: Vec<Backend>,

pub cuda: Option<CudaGeneral>,
Expand Down Expand Up @@ -183,6 +185,7 @@ impl From<General> for super::General {
name: general.name,
version: general.version,
license: general.license,
upstream: general.upstream,
backends: general.backends.into_iter().map(Into::into).collect(),
cuda: general.cuda.map(Into::into),
hub: general.hub.map(Into::into),
Expand Down Expand Up @@ -363,6 +366,7 @@ impl From<super::General> for General {
name: general.name,
version: general.version,
license: general.license,
upstream: general.upstream,
backends: general.backends.into_iter().map(Into::into).collect(),
cuda: general.cuda.map(Into::into),
hub: general.hub.map(Into::into),
Expand Down
1 change: 1 addition & 0 deletions kernel-builder/src/pyproject/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub fn write_metadata(general: &General, file_set: &mut FileSet) -> Result<()> {
let metadata = Metadata {
version: general.version,
license: general.license.clone(),
upstream: general.upstream.clone(),
python_depends,
};

Expand Down
2 changes: 2 additions & 0 deletions kernel-builder/src/pyproject/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ pub struct Metadata {
pub version: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub license: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub upstream: Option<url::Url>,
pub python_depends: Vec<String>,
}
1 change: 1 addition & 0 deletions template/build.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ backends = [
]
name = "__KERNEL_NAME__"
version = 1
upstream = "__UPSTREAM_URL__"

[torch]
src = [
Expand Down
Loading