Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
0b7a18ce
Unverified
Commit
0b7a18ce
authored
Apr 08, 2026
by
Graham King
Committed by
GitHub
Apr 08, 2026
Browse files
chore: Remove dependency memory -> config (#7993)
Signed-off-by:
Graham King
<
grahamk@nvidia.com
>
parent
a210efa6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
10 deletions
+43
-10
Cargo.lock
Cargo.lock
+0
-1
lib/bindings/kvbm/Cargo.lock
lib/bindings/kvbm/Cargo.lock
+0
-1
lib/bindings/python/Cargo.lock
lib/bindings/python/Cargo.lock
+0
-1
lib/memory/Cargo.toml
lib/memory/Cargo.toml
+0
-2
lib/memory/src/lib.rs
lib/memory/src/lib.rs
+40
-0
lib/memory/src/nixl/config.rs
lib/memory/src/nixl/config.rs
+1
-3
lib/memory/src/numa/mod.rs
lib/memory/src/numa/mod.rs
+1
-1
lib/memory/src/pinned.rs
lib/memory/src/pinned.rs
+1
-1
No files found.
Cargo.lock
View file @
0b7a18ce
...
...
@@ -1996,7 +1996,6 @@ version = "1.0.0"
dependencies = [
"anyhow",
"cudarc",
"dynamo-config",
"libc",
"nix 0.30.1",
"nixl-sys",
...
...
lib/bindings/kvbm/Cargo.lock
View file @
0b7a18ce
...
...
@@ -1647,7 +1647,6 @@ version = "1.0.0"
dependencies = [
"anyhow",
"cudarc",
"dynamo-config",
"libc",
"nix 0.30.1",
"nixl-sys",
...
...
lib/bindings/python/Cargo.lock
View file @
0b7a18ce
...
...
@@ -1662,7 +1662,6 @@ version = "1.0.0"
dependencies = [
"anyhow",
"cudarc",
"dynamo-config",
"libc",
"nix 0.30.1",
"nixl-sys",
...
...
lib/memory/Cargo.toml
View file @
0b7a18ce
...
...
@@ -23,8 +23,6 @@ testing-nixl = []
testing-all
=
[
"testing-cuda"
,
"testing-nixl"
]
[dependencies]
dynamo-config
=
{
workspace
=
true
}
anyhow
=
{
workspace
=
true
}
cudarc
=
{
workspace
=
true
}
nixl-sys
=
{
version
=
"=0.10.1"
}
...
...
lib/memory/src/lib.rs
View file @
0b7a18ce
...
...
@@ -301,3 +301,43 @@ impl MemoryRegion {
}
}
}
/// Check if an environment variable is truthy
pub
fn
env_is_truthy
(
env
:
&
str
)
->
bool
{
match
std
::
env
::
var
(
env
)
{
Ok
(
val
)
=>
matches!
(
val
.to_lowercase
()
.as_str
(),
"1"
|
"true"
|
"on"
|
"yes"
),
Err
(
_
)
=>
false
,
}
}
/// Parse a string as a boolean value, returning an error if invalid.
/// Do not use this unless you really need to support vague values. Prefer only allowing a specific
/// value.
///
/// This function strictly validates that the input is a valid boolean representation.
///
/// # Arguments
/// * `val` - The string value to parse
///
/// # Returns
/// * `Ok(true)` - For truthy values: "1", "true", "on", "yes" (case-insensitive)
/// * `Ok(false)` - For falsey values: "0", "false", "off", "no" (case-insensitive)
/// * `Err(_)` - For any other value
///
/// # Example
/// ```ignore
/// assert_eq!(parse_bool("true")?, true);
/// assert_eq!(parse_bool("0")?, false);
/// assert!(parse_bool("maybe").is_err());
/// ```
pub
fn
parse_bool
(
val
:
&
str
)
->
anyhow
::
Result
<
bool
>
{
if
matches!
(
val
.to_lowercase
()
.as_str
(),
"1"
|
"true"
|
"on"
|
"yes"
)
{
Ok
(
true
)
}
else
if
matches!
(
val
.to_lowercase
()
.as_str
(),
"0"
|
"false"
|
"off"
|
"no"
)
{
Ok
(
false
)
}
else
{
anyhow
::
bail!
(
"Invalid boolean value: '{val}'. Expected one of: true/false, 1/0, on/off, yes/no"
,
)
}
}
lib/memory/src/nixl/config.rs
View file @
0b7a18ce
...
...
@@ -10,8 +10,6 @@ use anyhow::{Result, bail};
use
serde
::{
Deserialize
,
Serialize
};
use
std
::
collections
::
HashMap
;
use
dynamo_config
::
parse_bool
;
/// Configuration for NIXL backends.
///
/// Supports extracting backend configurations from environment variables:
...
...
@@ -82,7 +80,7 @@ impl NixlBackendConfig {
// Simple backend enablement (e.g., DYN_KVBM_NIXL_BACKEND_UCX=true)
let
backend_name
=
remainder
.to_uppercase
();
match
parse_bool
(
&
value
)
{
match
crate
::
parse_bool
(
&
value
)
{
Ok
(
true
)
=>
{
backends
.insert
(
backend_name
,
HashMap
::
new
());
}
...
...
lib/memory/src/numa/mod.rs
View file @
0b7a18ce
...
...
@@ -45,7 +45,7 @@ static NUMA_NODE_CACHE: OnceLock<Mutex<HashMap<String, Option<NumaNode>>>> = Onc
/// NUMA-aware allocation is enabled by default. Set `DYN_MEMORY_DISABLE_NUMA=1`
/// (or any truthy value) to disable it.
pub
fn
is_numa_disabled
()
->
bool
{
dynamo_config
::
env_is_truthy
(
"DYN_MEMORY_DISABLE_NUMA"
)
crate
::
env_is_truthy
(
"DYN_MEMORY_DISABLE_NUMA"
)
}
/// Represents a NUMA node identifier.
...
...
lib/memory/src/pinned.rs
View file @
0b7a18ce
...
...
@@ -15,7 +15,7 @@ use std::sync::Arc;
/// (e.g. Grace Hopper / Blackwell with NVLink-C2C). Must be accessed only after
/// a CUDA context has been bound to the current thread.
static
USE_WRITE_COMBINED
:
std
::
sync
::
LazyLock
<
bool
>
=
std
::
sync
::
LazyLock
::
new
(||
{
if
dynamo_config
::
env_is_truthy
(
"DYN_KVBM_DISABLE_WRITE_COMBINED"
)
{
if
crate
::
env_is_truthy
(
"DYN_KVBM_DISABLE_WRITE_COMBINED"
)
{
tracing
::
debug!
(
"DYN_KVBM_DISABLE_WRITE_COMBINED set; write-combined disabled"
);
return
false
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment