https://github.com/mmore500/compconf
compconf enables flexible, type-rich comptime configuration of Cerebras Software Language (CSL) projects
https://github.com/mmore500/compconf
Last synced: about 1 month ago
JSON representation
compconf enables flexible, type-rich comptime configuration of Cerebras Software Language (CSL) projects
- Host: GitHub
- URL: https://github.com/mmore500/compconf
- Owner: mmore500
- License: mit
- Created: 2024-12-19T21:40:33.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-01-08T02:17:04.000Z (5 months ago)
- Last Synced: 2025-03-26T04:47:59.645Z (3 months ago)
- Language: Python
- Size: 78.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# compconf
[](https://github.com/mmore500/compconf/actions/workflows/python-ci.yaml?query=branch:python)
[](https://github.com/mmore500/compconf)
[

](https://pypi.python.org/pypi/compconf)compconf enables flexible, type-rich comptime configuration of Cerebras Software Language (CSL) projects
- Free software: MIT license
## Usage
compconf wraps the `cslc` compiler, forwarding all non-compconf flags.
```bash
python3 -m compconf --compconf-jq '. += {"baz:f32": 42.0}'
```Access configuration values in csl code using the `compconf` module.
```zig
const compconf = @import("compconf.zig");fn main() void {
@comptime_print(compconf.get_value("baz", f32));
@comptime_print(compconf.get_value_or("bar", @as(f16, 24.0)));
}
```The `compconf` module provides the following functions:
```zig
fn get_value(comptime field_name: comptime_string, comptime T: type) Tfn get_value_or(
comptime field_name: comptime_string, comptime default_value: anytype
) @type_of(default_value)
```Available options:
```
usage: __main__.py [-h] [--compconf-cslc COMPCONF_CSLC] [--compconf-data COMPCONF_DATA] [--compconf-jq COMPCONF_JQ] [--compconf-verbose]compconf enables flexible, type-rich comptime configuration of csl projects.
options:
-h, --help show this help message and exit
--compconf-cslc COMPCONF_CSLC
compiler command to run
--compconf-data COMPCONF_DATA
json data file to read, if any
--compconf-jq COMPCONF_JQ
jq command to add/modify data (e.g., '. += {"foo:u32": 42}')
--compconf-verbose enable verbose loggingJSON data must be formatted according to `@import_comptime_value` conventions. See DISCLAIMER: Cerebras Software
Language is the intellectual property of Cerebras Systems, Inc. This project is not an official Cerebras project and is not affiliated with or endorsed by Cerebras Systems, Inc. in any
way. All trademarks, logos, and intellectual property associated with Cerebras Systems remain the exclusive property of Cerebras Systems, Inc.
```## Singularity Container
A containerized release of `compconf` is available via
```bash
singularity exec docker://ghcr.io/mmore500/compconf:v0.5.3 python3 -m compconf --help
```## Installation
To install from PyPi with pip, run
`python3 -m pip install compconf`
## Disclaimer
Cerebras Software Language is the intellectual property of Cerebras Systems, Inc.
This project is not an official Cerebras project and is not affiliated with or endorsed by Cerebras Systems, Inc. in any way.
All trademarks, logos, and intellectual property associated with Cerebras Systems remain the exclusive property of Cerebras Systems, Inc.