#!/usr/bin/env bash #************************************************************************** #|| SiMa.ai CONFIDENTIAL || #|| Unpublished Copyright (c) 2025 SiMa.ai, All Rights Reserved. || #************************************************************************** # NOTICE: All information contained herein is, and remains the property of # SiMa.ai. The intellectual and technical concepts contained herein are # proprietary to SiMa and may be covered by U.S. and Foreign Patents, # patents in process, and are protected by trade secret or copyright law. # # Dissemination of this information or reproduction of this material is # strictly forbidden unless prior written permission is obtained from # SiMa.ai. Access to the source code contained herein is hereby forbidden # to anyone except current SiMa.ai employees, managers or contractors who # have executed Confidentiality and Non-disclosure agreements explicitly # covering such access. # # The copyright notice above does not evidence any actual or intended # publication or disclosure of this source code, which includes information # that is confidential and/or proprietary, and is a trade secret, of SiMa.ai. # # ANY REPRODUCTION, MODIFICATION, DISTRIBUTION, PUBLIC PERFORMANCE, OR PUBLIC # DISPLAY OF OR THROUGH USE OF THIS SOURCE CODE WITHOUT THE EXPRESS WRITTEN # CONSENT OF SiMa.ai IS STRICTLY PROHIBITED, AND IN VIOLATION OF APPLICABLE # LAWS AND INTERNATIONAL TREATIES. THE RECEIPT OR POSSESSION OF THIS SOURCE # CODE AND/OR RELATED INFORMATION DOES NOT CONVEY OR IMPLY ANY RIGHTS TO # REPRODUCE, DISCLOSE OR DISTRIBUTE ITS CONTENTS, OR TO MANUFACTURE, USE, OR # SELL ANYTHING THAT IT MAY DESCRIBE, IN WHOLE OR IN PART. # #************************************************************************** # Download the HuggingFace mistralai/Mistral-7B-Instruct-v0.3 using the following command. # huggingface-cli download mistralai/Mistral-7B-Instruct-v0.3 TMPDIR=$(mktemp -d /tmp/sima.XXXXXX) function cleanup () { rm -r ${TMPDIR} } trap cleanup EXIT cat >${TMPDIR}/config.py <<'EOF' def get_layer_configuration(model_properties, layer): if layer["is_group"]: precision = "A_BF16_W_INT8" else: precision = "A_BF16_W_INT4" return {"precision": precision} EOF llima-compile -c ${TMPDIR}/config.py --max_num_tokens 2048 $@