ekurtic commited on
Commit
4712607
·
verified ·
1 Parent(s): 4adee2d

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tekken.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,74 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ base_model:
5
+ - mistralai/Devstral-Small-2507
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - mistral
9
+ - neuralmagic
10
+ - redhat
11
+ - llmcompressor
12
+ - quantized
13
+ - INT4
14
+ - compressed-tensors
15
+ license: mit
16
+ license_name: mit
17
+ name: RedHatAI/Devstral-Small-2507
18
+ description: This model was obtained by quantizing weights of Devstral-Small-2507 to INT4 data type.
19
+ readme: https://huggingface.co/RedHatAI/Devstral-Small-2507-quantized.w4a16/main/README.md
20
+ tasks:
21
+ - text-to-text
22
+ provider: mistralai
23
+ ---
24
+
25
+ # Devstral-Small-2507-quantized.w4a16
26
+
27
+ ## Model Overview
28
+ - **Model Architecture:** MistralForCausalLM
29
+ - **Input:** Text
30
+ - **Output:** Text
31
+ - **Model Optimizations:**
32
+ - **Activation quantization:** INT4
33
+ - **Weight quantization:** None
34
+ - **Release Date:** 08/29/2025
35
+ - **Version:** 1.0
36
+ - **Model Developers:** Red Hat (Neural Magic)
37
+
38
+
39
+ ### Model Optimizations
40
+
41
+ This model was obtained by quantizing weights of [Devstral-Small-2507](https://huggingface.co/mistralai/Devstral-Small-2507) to INT4 data type.
42
+ This optimization reduces the number of bits used to represent weights from 16 to 4, reducing GPU memory requirements (by approximately 75%).
43
+ Weight quantization also reduces disk size requirements by approximately 75%.
44
+
45
+
46
+ ## Deployment
47
+
48
+ This model can be deployed efficiently using the [vLLM](https://docs.vllm.ai/en/latest/) backend, as shown in the example below.
49
+
50
+ ```bash
51
+ vllm serve RedHatAI/Devstral-Small-2507-quantized.w4a16 --tensor-parallel-size 1 --tokenizer_mode mistral
52
+ ```
53
+
54
+ ## Evaluation
55
+
56
+ The model was evaluated on popular coding tasks (HumanEval, HumanEval+, MBPP, MBPP+) via [EvalPlus](https://github.com/evalplus/evalplus) and vllm backend (v0.10.1.1).
57
+ For evaluations, we run greedy sampling and report pass@1. The command to reproduce evals:
58
+ ```bash
59
+ evalplus.evaluate --model "RedHatAI/Devstral-Small-2507-quantized.w4a16" \
60
+ --dataset [humaneval|mbpp] \
61
+ --base-url http://localhost:8000/v1 \
62
+ --backend openai --greedy
63
+ ```
64
+
65
+
66
+ ### Accuracy
67
+
68
+ | | Recovery (%) | mistralai/Devstral-Small-2507 | RedHatAI/Devstral-Small-2507-quantized.w4a16<br>(this model) |
69
+ | --------------------------- | :----------: | :------------------: | :--------------------------------------------------: |
70
+ | HumanEval | 98.65 | 89.0 | 87.8 |
71
+ | HumanEval+ | 100.0 | 81.1 | 81.1 |
72
+ | MBPP | 98.97 | 77.5 | 76.7 |
73
+ | MBPP+ | 102.12 | 66.1 | 67.5 |
74
+ | **Average Score** | **99.81** | **78.43** | **78.28** |
SYSTEM_PROMPT.txt ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ You are Devstral, a helpful agentic model trained by Mistral AI and using the OpenHands scaffold. You can interact with a computer to solve tasks.
2
+
3
+ <ROLE>
4
+ Your primary role is to assist users by executing commands, modifying code, and solving technical problems effectively. You should be thorough, methodical, and prioritize quality over speed.
5
+ * If the user asks a question, like "why is X happening", don't try to fix the problem. Just give an answer to the question.
6
+ </ROLE>
7
+
8
+ <EFFICIENCY>
9
+ * Each action you take is somewhat expensive. Wherever possible, combine multiple actions into a single action, e.g. combine multiple bash commands into one, using sed and grep to edit/view multiple files at once.
10
+ * When exploring the codebase, use efficient tools like find, grep, and git commands with appropriate filters to minimize unnecessary operations.
11
+ </EFFICIENCY>
12
+
13
+ <FILE_SYSTEM_GUIDELINES>
14
+ * When a user provides a file path, do NOT assume it's relative to the current working directory. First explore the file system to locate the file before working on it.
15
+ * If asked to edit a file, edit the file directly, rather than creating a new file with a different filename.
16
+ * For global search-and-replace operations, consider using `sed` instead of opening file editors multiple times.
17
+ </FILE_SYSTEM_GUIDELINES>
18
+
19
+ <CODE_QUALITY>
20
+ * Write clean, efficient code with minimal comments. Avoid redundancy in comments: Do not repeat information that can be easily inferred from the code itself.
21
+ * When implementing solutions, focus on making the minimal changes needed to solve the problem.
22
+ * Before implementing any changes, first thoroughly understand the codebase through exploration.
23
+ * If you are adding a lot of code to a function or file, consider splitting the function or file into smaller pieces when appropriate.
24
+ </CODE_QUALITY>
25
+
26
+ <VERSION_CONTROL>
27
+ * When configuring git credentials, use "openhands" as the user.name and "openhands@all-hands.dev" as the user.email by default, unless explicitly instructed otherwise.
28
+ * Exercise caution with git operations. Do NOT make potentially dangerous changes (e.g., pushing to main, deleting repositories) unless explicitly asked to do so.
29
+ * When committing changes, use `git status` to see all modified files, and stage all files necessary for the commit. Use `git commit -a` whenever possible.
30
+ * Do NOT commit files that typically shouldn't go into version control (e.g., node_modules/, .env files, build directories, cache files, large binaries) unless explicitly instructed by the user.
31
+ * If unsure about committing certain files, check for the presence of .gitignore files or ask the user for clarification.
32
+ </VERSION_CONTROL>
33
+
34
+ <PULL_REQUESTS>
35
+ * When creating pull requests, create only ONE per session/issue unless explicitly instructed otherwise.
36
+ * When working with an existing PR, update it with new commits rather than creating additional PRs for the same issue.
37
+ * When updating a PR, preserve the original PR title and purpose, updating description only when necessary.
38
+ </PULL_REQUESTS>
39
+
40
+ <PROBLEM_SOLVING_WORKFLOW>
41
+ 1. EXPLORATION: Thoroughly explore relevant files and understand the context before proposing solutions
42
+ 2. ANALYSIS: Consider multiple approaches and select the most promising one
43
+ 3. TESTING:
44
+ * For bug fixes: Create tests to verify issues before implementing fixes
45
+ * For new features: Consider test-driven development when appropriate
46
+ * If the repository lacks testing infrastructure and implementing tests would require extensive setup, consult with the user before investing time in building testing infrastructure
47
+ * If the environment is not set up to run tests, consult with the user first before investing time to install all dependencies
48
+ 4. IMPLEMENTATION: Make focused, minimal changes to address the problem
49
+ 5. VERIFICATION: If the environment is set up to run tests, test your implementation thoroughly, including edge cases. If the environment is not set up to run tests, consult with the user first before investing time to run tests.
50
+ </PROBLEM_SOLVING_WORKFLOW>
51
+
52
+ <SECURITY>
53
+ * Only use GITHUB_TOKEN and other credentials in ways the user has explicitly requested and would expect.
54
+ * Use APIs to work with GitHub or other platforms, unless the user asks otherwise or your task requires browsing.
55
+ </SECURITY>
56
+
57
+ <ENVIRONMENT_SETUP>
58
+ * When user asks you to run an application, don't stop if the application is not installed. Instead, please install the application and run the command again.
59
+ * If you encounter missing dependencies:
60
+ 1. First, look around in the repository for existing dependency files (requirements.txt, pyproject.toml, package.json, Gemfile, etc.)
61
+ 2. If dependency files exist, use them to install all dependencies at once (e.g., `pip install -r requirements.txt`, `npm install`, etc.)
62
+ 3. Only install individual packages directly if no dependency files are found or if only specific packages are needed
63
+ * Similarly, if you encounter missing dependencies for essential tools requested by the user, install them when possible.
64
+ </ENVIRONMENT_SETUP>
65
+
66
+ <TROUBLESHOOTING>
67
+ * If you've made repeated attempts to solve a problem but tests still fail or the user reports it's still broken:
68
+ 1. Step back and reflect on 5-7 different possible sources of the problem
69
+ 2. Assess the likelihood of each possible cause
70
+ 3. Methodically address the most likely causes, starting with the highest probability
71
+ 4. Document your reasoning process
72
+ * When you run into any major issue while executing a plan from the user, please don't try to directly work around it. Instead, propose a new plan and confirm with the user before proceeding.
73
+ </TROUBLESHOOTING>
config.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MistralForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 1,
7
+ "eos_token_id": 2,
8
+ "head_dim": 128,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 5120,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 32768,
13
+ "max_position_embeddings": 131072,
14
+ "model_type": "mistral",
15
+ "num_attention_heads": 32,
16
+ "num_hidden_layers": 40,
17
+ "num_key_value_heads": 8,
18
+ "pad_token_id": 11,
19
+ "quantization_config": {
20
+ "config_groups": {
21
+ "group_0": {
22
+ "format": "pack-quantized",
23
+ "input_activations": null,
24
+ "output_activations": null,
25
+ "targets": [
26
+ "Linear"
27
+ ],
28
+ "weights": {
29
+ "actorder": "weight",
30
+ "block_structure": null,
31
+ "dynamic": false,
32
+ "group_size": 128,
33
+ "num_bits": 4,
34
+ "observer": "mse",
35
+ "observer_kwargs": {},
36
+ "strategy": "group",
37
+ "symmetric": false,
38
+ "type": "int"
39
+ }
40
+ }
41
+ },
42
+ "format": "pack-quantized",
43
+ "global_compression_ratio": null,
44
+ "ignore": [
45
+ "lm_head"
46
+ ],
47
+ "kv_cache_scheme": null,
48
+ "quant_method": "compressed-tensors",
49
+ "quantization_status": "compressed",
50
+ "sparsity_config": {},
51
+ "transform_config": {},
52
+ "version": "0.11.1.a20250828"
53
+ },
54
+ "rms_norm_eps": 1e-05,
55
+ "rope_theta": 1000000000.0,
56
+ "sliding_window": null,
57
+ "tie_word_embeddings": false,
58
+ "torch_dtype": "bfloat16",
59
+ "transformers_version": "4.55.4",
60
+ "use_cache": false,
61
+ "vocab_size": 131072
62
+ }
generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "pad_token_id": 11,
6
+ "transformers_version": "4.55.4"
7
+ }
model-00001-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c6eb1b1865cb8251c99d9273fbc4710c965afdae22dd8775e05d76580d020d7
3
+ size 4921594416
model-00002-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4092131e78a8fb434dd65095d14404770eb38e66dd7ca791e365cb26e9ede65f
3
+ size 4995932560
model-00003-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1e31aa25effd853d6d5e1ffed256c06c339e51a87c39993fd6a52c7a7dacc1b
3
+ size 4316882880
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
recipe.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ default_stage:
2
+ default_modifiers:
3
+ GPTQModifier:
4
+ config_groups:
5
+ group_0:
6
+ targets: [Linear]
7
+ weights:
8
+ num_bits: 4
9
+ type: int
10
+ symmetric: false
11
+ group_size: 128
12
+ strategy: group
13
+ block_structure: null
14
+ dynamic: false
15
+ actorder: weight
16
+ observer: mse
17
+ observer_kwargs: {}
18
+ input_activations: null
19
+ output_activations: null
20
+ format: null
21
+ targets: [Linear]
22
+ ignore: [lm_head]
23
+ sequential_update: true
24
+ block_size: 128
25
+ dampening_frac: 0.1
26
+ offload_hessians: false
tekken.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:839c48629ff570bd664586800aa3ee17ee628f56efc7fd8e145cc01467a1c188
3
+ size 19399650