Skip to main content

compconf enables flexible, type-rich comptime configuration of Cerebras Software Language (CSL) projects

Project description

compconf

CI GitHub stars PyPi

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.

python3 -m compconf --compconf-jq '. += {"baz:f32": 42.0}'

Access configuration values in csl code using the compconf module.

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:

fn get_value(comptime field_name: comptime_string, comptime T: type) T

fn 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 logging

JSON data must be formatted according to `@import_comptime_value` conventions. See <https://sdk.cerebras.net/csl/language/builtins#import-comptime-value> 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 <ghcr.io>

singularity exec docker://ghcr.io/mmore500/compconf:v0.6.2 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

compconf-0.6.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

compconf-0.6.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file compconf-0.6.2.tar.gz.

File metadata

  • Download URL: compconf-0.6.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for compconf-0.6.2.tar.gz
Algorithm Hash digest
SHA256 81fa38a32d6371a67e943b4946621bedb8f9d9c5484e65479a7b443907b4832f
MD5 0385b941769afc19a1f4b203b1a88456
BLAKE2b-256 b7d1783e0b27b564b73e53b01cac41ba9dc98d79364a2b70fcb15a2f954c42c7

See more details on using hashes here.

File details

Details for the file compconf-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: compconf-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for compconf-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 df8358b0dc1422ee9979011c79969d986007d319a1542e775cab946f334dffb1
MD5 aac23ad4e54223fb052516722cc1046d
BLAKE2b-256 6c460cf47a4c5b3629aa52cb4b8dfb308a9a81011e179a2dec2f6f20e3f86485

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page