Initial commit
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
//! Tests for RCCL module.
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::super::*;
|
||||
|
||||
#[test]
|
||||
fn test_rccl_config_default() {
|
||||
let config = RcclConfig::default();
|
||||
assert_eq!(config.debug_level, "INFO");
|
||||
assert!(config.enable_gdr);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rccl_unique_id() {
|
||||
let id = RcclUniqueId::default();
|
||||
assert_eq!(id.internal.len(), 128);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rccl_data_types() {
|
||||
assert_eq!(RcclDataType::Float32 as i32, 7);
|
||||
assert_eq!(RcclDataType::Float16 as i32, 6);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rccl_reduce_ops() {
|
||||
assert_eq!(RcclReduceOp::Sum as i32, 0);
|
||||
assert_eq!(RcclReduceOp::Max as i32, 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_reduce_op_conversion() {
|
||||
let sum: RcclReduceOp = crate::comm::ReduceOp::Sum.into();
|
||||
assert_eq!(sum, RcclReduceOp::Sum);
|
||||
|
||||
let max: RcclReduceOp = crate::comm::ReduceOp::Max.into();
|
||||
assert_eq!(max, RcclReduceOp::Max);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_rccl_backend_creation() {
|
||||
let config = RcclConfig::default();
|
||||
let backend = RcclBackend::new(config);
|
||||
assert!(backend.world_comm.read().is_none());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user