data: publish complete Calculet NPU research archive

This commit is contained in:
2026-08-02 14:57:11 +08:00
parent b5c4fbffab
commit 98e6cadcb6
12400 changed files with 6166642 additions and 0 deletions
@@ -0,0 +1 @@
[ERROR | 2026-04-09 17:13:21.535] /home/wangbomeng/calrt/hostrt/src/device/calrt_device.cpp:801 | Calrt Error --> CalrtErrorTimeout: Failed to deploy weights to Device
@@ -0,0 +1 @@
[ERROR | 2026-04-09 17:13:30.735] /home/wangbomeng/calrt/hostrt/src/device/calrt_device.cpp:801 | Calrt Error --> CalrtErrorTimeout: Failed to deploy weights to Device
@@ -0,0 +1 @@
[ERROR | 2026-04-09 17:13:44.088] /home/wangbomeng/calrt/hostrt/src/device/calrt_device.cpp:801 | Calrt Error --> CalrtErrorTimeout: Failed to deploy weights to Device
@@ -0,0 +1 @@
[ERROR | 2026-04-09 17:14:27.852] /home/wangbomeng/calrt/hostrt/src/device/calrt_device.cpp:801 | Calrt Error --> CalrtErrorTimeout: Failed to deploy weights to Device
@@ -0,0 +1,2 @@
[ERROR | 2026-02-26 03:12:40.709] /home/wangbomeng/calrt/hostrt/src/device/calrt_driver.cpp:595 | Calrt Error --> CalrtErrorNoDevice: No valid Calculet PCIe devices found
[ERROR | 2026-02-26 03:12:40.709] /home/wangbomeng/calrt/hostrt/src/device/calrt_pcie_device.cpp:15 | Calrt Error --> CalrtErrorDeviceUnavailable: No available device
@@ -0,0 +1,2 @@
[ERROR | 2026-04-17 14:54:27.428] /home/wangbomeng/calrt/hostrt/src/deploy/calrt_calbin.cpp:92 | Calrt Error --> CalrtErrorInvalidValue: Invalid directory path: /home/wangbomeng/cal-llama/llama.cpp/../../models/onetoken/Qwen2.5-0.5B-Instruct-dynamic-W8A8-W4AF16_4096_fa/calbin/.
[ERROR | 2026-04-17 14:54:27.429] /home/wangbomeng/calrt/hostrt/src/deploy/calrt_deploy.cpp:19 | Calrt Error --> CalrtErrorAssert: Calbin pointer is nullptr
@@ -0,0 +1,2 @@
[ERROR | 2026-04-17 14:54:43.619] /home/wangbomeng/calrt/hostrt/src/deploy/calrt_calbin.cpp:92 | Calrt Error --> CalrtErrorInvalidValue: Invalid directory path: /home/wangbomeng/cal-llama/llama.cpp/../../models/onetoken/Qwen2.5-0.5B-Instruct-dynamic-W8A8-W4AF16_4096_fa/.
[ERROR | 2026-04-17 14:54:43.619] /home/wangbomeng/calrt/hostrt/src/deploy/calrt_deploy.cpp:19 | Calrt Error --> CalrtErrorAssert: Calbin pointer is nullptr
@@ -0,0 +1,2 @@
[ERROR | 2026-04-09 14:44:16.521] /home/wangbomeng/calrt/hostrt/src/deploy/calrt_calbin.cpp:117 | Calrt Error --> CalrtErrorInvalidCalbin: Calbin is lack of global memory description. [/home/wangbomeng/cal-llama/llama.cpp/../../models/Qwen2.5-0.5B-Instruct-dynamic-W8A8-W4AF16_4096_fa/]
[ERROR | 2026-04-09 14:44:16.522] /home/wangbomeng/calrt/hostrt/src/deploy/calrt_deploy.cpp:19 | Calrt Error --> CalrtErrorAssert: Calbin pointer is nullptr
@@ -0,0 +1 @@
[ERROR | 2026-04-10 18:16:06.612] /home/wangbomeng/calrt/hostrt/src/device/calrt_pcie_device.cpp:15 | Calrt Error --> CalrtErrorDeviceUnavailable: No available device
@@ -0,0 +1 @@
[ERROR | 2026-04-10 18:16:24.002] /home/wangbomeng/calrt/hostrt/src/device/calrt_pcie_device.cpp:15 | Calrt Error --> CalrtErrorDeviceUnavailable: No available device
@@ -0,0 +1 @@
[ERROR | 2026-04-10 18:22:25.241] /home/wangbomeng/calrt/hostrt/src/device/calrt_pcie_device.cpp:15 | Calrt Error --> CalrtErrorDeviceUnavailable: No available device
@@ -0,0 +1 @@
[ERROR | 2026-04-10 18:29:41.324] /home/wangbomeng/calrt/hostrt/src/device/calrt_pcie_device.cpp:15 | Calrt Error --> CalrtErrorDeviceUnavailable: No available device
@@ -0,0 +1 @@
[ERROR | 2026-04-10 19:07:23.510] /home/wangbomeng/calrt/hostrt/src/device/calrt_pcie_device.cpp:15 | Calrt Error --> CalrtErrorDeviceUnavailable: No available device
@@ -0,0 +1,2 @@
[ERROR | 2026-05-13 12:24:24.246] Calrt Error --> CalrtErrorInvalidValue: Invalid directory path: .
[ERROR | 2026-05-13 12:24:24.247] Calrt Error --> CalrtErrorAssert: Calbin pointer is nullptr
@@ -0,0 +1,2 @@
[ERROR | 2026-05-13 14:04:18.231] Calrt Error --> CalrtErrorInvalidValue: Invalid directory path: .
[ERROR | 2026-05-13 14:04:18.232] Calrt Error --> CalrtErrorAssert: Calbin pointer is nullptr
@@ -0,0 +1 @@
[ERROR | 2026-02-06 01:46:15.373] /home/wangbomeng/calrt/hostrt/src/device/calrt_device.cpp:114 | Calrt Error --> CalrtErrorTimeout: Failed to Configure Model [DeepSeek-R1-Distill-Qwen-7B-decode64-W8A8-W4AF16-2layers-Dynamic_Input_with_KVcache-clib] to Device at step --> Set up Global Data
@@ -0,0 +1,2 @@
[ERROR | 2026-05-13 14:07:04.980] Calrt Error --> CalrtErrorInvalidValue: Invalid directory path: .
[ERROR | 2026-05-13 14:07:04.981] Calrt Error --> CalrtErrorAssert: Calbin pointer is nullptr
@@ -0,0 +1,757 @@
timestamp,model,prompt,content
2026-04-09 20:45:22,deepseek,Result only: 2 + 2 = ?,"**Solution:**
We need to find the result of \(2 + 2\).
1. **Addition:**
\[
2 + + 2 = 4
\]
**Final Answer:**
\boxed{4}"
2026-04-09 20:51:29,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:51:30,deepseek,Result only: 2 + 2 = ?,The result of 2 + 2 is 4.
2026-04-09 20:51:31,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:51:32,deepseek,Result only: 2 + 2 = ?,"I am a program that was created by Alibaba Cloud. I was trained on large amounts of text data to understand natural language.
My purpose is to assist users in understanding the meaning of words and phrases, as well as providing information about various topics. I can answer questions on many different subjects such as science, history, culture, etc."
2026-04-09 20:51:33,deepseek,Result only: 2 + 2 = ?,"I am a program that was created by Alibaba Cloud. I was trained on large amounts of text data to understand natural language.
My purpose is to assist users in understanding the meaning of words and phrases, as well as providing information about various topics. I can answer questions on many different subjects such as science, history, culture, etc."
2026-04-09 20:51:39,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j + 1] < arr[j]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
bubbleSort(arr, sizeof(arr) / sizeof(int));
printArray(arr, sizeof(arr) / sizeof(int));
return 0;
}
```
这段代码首先定义了一个函数 `bubbleSort`,它接受一个整数数组和它的大小。然后调用这个函数对数组进行排序,并打印排序后的结果。
当你运行这段代码时,你会看到以下输出:
```
21
59
37
42
86
```
这表明排序成功地完成了。注意,这里使用了 `bubbleSort` 函数来实现冒泡排序,而不是使用 `sort()` 方法。"
2026-04-09 20:51:44,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j] > arr[j + 1]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
int n = sizeof(arr) / sizeof(arr[0]);
bubbleSort(arr, n);
cout << ""Sorted array is: \n"";
printArray(arr, n);
}
```
这段代码首先定义了一个冒泡排序函数,然后在主函数中调用这个函数并打印出排序后的数组。你可以将 `arr[]` 和 `n` 的值设置为你自己的数组或列表。
注意:这个实现是按升序排序的,如果你需要按降序排序,请使用 `sort()` 函数。"
2026-04-09 20:51:49,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j] > arr[j + 1]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
int n = sizeof(arr) / sizeof(arr[0]);
bubbleSort(arr, n);
cout << ""Sorted array is: \n"";
printArray(arr, n);
}
```
这段代码首先定义了一个冒泡排序函数,然后在主函数中调用这个函数并打印出排序后的数组。你可以将 `arr[]` 和 `n` 的值设置为你自己的数组或列表。
注意:这个实现是按升序排序的,如果你需要按降序排序,请使用 `sort()` 函数。"
2026-04-09 20:51:50,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:51:50,deepseek,Result only: 2 + 2 = ?,The result of 2 + 2 is 4.
2026-04-09 20:51:51,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:51:52,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was trained on a large corpus of text data to understand human speech and respond appropriately. My purpose is to assist users in finding information, answer questions, and provide helpful responses to their inquiries. Is there anything specific you would like me to help you with?"
2026-04-09 20:51:54,deepseek,Result only: 2 + 2 = ?,"I am a program that was created by Alibaba Cloud. I was trained on large amounts of text data to understand natural language.
My purpose is to assist users in understanding and generating human-like responses to their questions or prompts. I can answer a wide range of topics, including science, history, culture, etc.
However, please note that my knowledge may be limited by the amount of training data I was trained on."
2026-04-09 20:51:59,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j + 1] < arr[j]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
bubbleSort(arr, sizeof(arr) / sizeof(int));
printArray(arr, sizeof(arr) / sizeof(int));
return 0;
}
```
这段代码首先定义了一个函数 `bubbleSort`,它接受一个整数数组和它的大小。然后调用这个函数对数组进行排序,并打印排序后的结果。
当你运行这段代码时,你会看到以下输出:
```
21
59
37
42
86
```
这表明排序成功地完成了。注意,这里使用了 `bubbleSort` 函数来实现冒泡排序,而不是使用 `sort()` 方法。"
2026-04-09 20:52:05,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j] > arr[j + 1]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
int n = sizeof(arr) / sizeof(arr[0]);
bubbleSort(arr, n);
cout << ""Sorted array is: \n"";
printArray(arr, n);
}
```
这段代码首先定义了一个冒泡排序函数,然后在主函数中调用这个函数并打印出排序后的数组。你可以将 `arr[]` 和 `n` 的值设置为你自己的数组或列表。
注意:这个实现是按升序排序的,如果你需要按降序排序,请使用 `sort()` 函数。"
2026-04-09 20:52:06,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:52:11,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j + 1] < arr[j]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
bubbleSort(arr, sizeof(arr) / sizeof(int));
printArray(arr, sizeof(arr) / sizeof(int));
return 0;
}
```
这段代码首先定义了一个函数 `bubbleSort`,它接受一个整数数组和它的大小。然后调用这个函数对数组进行排序,并打印排序后的结果。
当你运行这段代码时,你会看到以下输出:
```
21
59
37
42
86
```
这表明排序成功地完成了。注意,这里使用了 `bubbleSort` 函数来实现冒泡排序,而不是使用 `sort()` 方法。"
2026-04-09 20:52:11,deepseek,Result only: 2 + 2 = ?,The result of 2 + 2 is 4.
2026-04-09 20:52:12,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:52:14,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was trained on a large corpus of text data to understand human speech and respond appropriately. My purpose is to assist users in finding information, answer questions, and provide helpful responses to their inquiries. Is there anything specific you would like me to help you with?"
2026-04-09 20:52:15,deepseek,Result only: 2 + 2 = ?,"I am a program that was created by Alibaba Cloud. I was trained on large amounts of text data to understand natural language.
My purpose is to assist users in understanding and generating human-like responses to their questions or prompts. I can answer a wide range of topics, including science, history, culture, etc.
However, please note that my knowledge may be limited by the amount of training data I was trained on."
2026-04-09 20:52:16,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:52:16,deepseek,Result only: 2 + 2 = ?,The result of 2 + 2 is 4.
2026-04-09 20:52:17,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:52:23,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j + 1] < arr[j]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
bubbleSort(arr, sizeof(arr) / sizeof(int));
printArray(arr, sizeof(arr) / sizeof(int));
return 0;
}
```
这段代码首先定义了一个函数 `bubbleSort`,它接受一个整数数组和它的大小。然后调用这个函数对数组进行排序,并打印排序后的结果。
当你运行这段代码时,你会看到以下输出:
```
21
59
37
42
86
```
这表明排序成功地完成了。注意,这里使用了 `bubbleSort` 函数来实现冒泡排序,而不是使用 `sort()` 方法。"
2026-04-09 20:52:28,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j] > arr[j + 1]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
int n = sizeof(arr) / sizeof(arr[0]);
bubbleSort(arr, n);
cout << ""Sorted array is: \n"";
printArray(arr, n);
}
```
这段代码首先定义了一个冒泡排序函数,然后在主函数中调用这个函数并打印出排序后的数组。你可以将 `arr[]` 和 `n` 的值设置为你自己的数组或列表。
注意:这个实现是按升序排序的,如果你需要按降序排序,请使用 `sort()` 函数。"
2026-04-09 20:52:32,deepseek,Result only: 2 + 2 = ?,"```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j + 1] < arr[j]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void swap(int a, int b) {
int temp = a;
a = b;
b = temp;
}
int main() {
int arr[] = {42, 37, 56, 29, 8};
bubbleSort(arr, sizeof(arr)/sizeof(arr[0]));
for (int i = 0; i < sizeof(arr); i++) {
cout << ""arr["" << i << ""] = "" << arr[i] << endl;
}
return 0;
}
```
这段代码首先定义了一个`bubbleSort`函数,用于对数组进行冒泡排序。然后在主函数中调用这个函数并打印出排序后的数组。"
2026-04-09 20:52:37,deepseek,Result only: 2 + 2 = ?,"```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j + 1] < arr[j]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void swap(int a, int b) {
int temp = a;
a = b;
b = temp;
}
int main() {
int arr[] = {42, 37, 56, 29, 8};
bubbleSort(arr, sizeof(arr)/sizeof(arr[0]));
for (int i = 0; i < sizeof(arr); i++) {
cout << ""arr["" << i << ""] = "" << arr[i] << endl;
}
return 0;
}
```
这段代码首先定义了一个`bubbleSort`函数,用于对数组进行冒泡排序。然后在主函数中调用这个函数并打印出排序后的数组。"
2026-04-09 20:52:38,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:52:39,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was trained on a large corpus of text data to understand human speech and respond appropriately. My purpose is to assist users in finding information, answer questions, and provide helpful responses to their inquiries. Is there anything specific you would like me to help you with?"
2026-04-09 20:52:39,deepseek,Result only: 2 + 2 = ?,The result of 2 + 2 is 4.
2026-04-09 20:52:39,deepseek,Result only: 2 + 2 = ?,The result of 2 + 2 is 4.
2026-04-09 20:52:40,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:52:41,deepseek,Result only: 2 + 2 = ?,"I am a program that was created by Alibaba Cloud. I was trained on large amounts of text data to understand natural language.
My purpose is to assist users in understanding the meaning of words and phrases, as well as providing information about various topics. I can answer questions on many different subjects such as science, history, culture, etc."
2026-04-09 20:52:43,deepseek,Result only: 2 + 2 = ?,"I am a program that was created by Alibaba Cloud. I was trained on large amounts of text data to understand natural language.
My purpose is to assist users in understanding the meaning of words and phrases, as well as providing information about various topics. I can answer questions on many different subjects such as science, history, culture, etc."
2026-04-09 20:52:48,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j + 1] < arr[j]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
bubbleSort(arr, sizeof(arr) / sizeof(int));
printArray(arr, sizeof(arr) / sizeof(int));
return 0;
}
```
这段代码首先定义了一个函数 `bubbleSort`,它接受一个整数数组和它的大小。然后调用这个函数对数组进行排序,并打印排序后的结果。
当你运行这段代码时,你会看到以下输出:
```
21
59
37
42
86
```
这表明排序成功地完成了。注意,这里使用了 `bubbleSort` 函数来实现冒泡排序,而不是使用 `sort()` 方法。"
2026-04-09 20:52:53,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j] > arr[j + 1]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
int n = sizeof(arr) / sizeof(arr[0]);
bubbleSort(arr, n);
cout << ""Sorted array is: \n"";
printArray(arr, n);
}
```
这段代码首先定义了一个冒泡排序函数,然后在主函数中调用这个函数并打印出排序后的数组。你可以将 `arr[]` 和 `n` 的值设置为你自己的数组或列表。
注意:这个实现是按升序排序的,如果你需要按降序排序,请使用 `sort()` 函数。"
2026-04-09 20:52:58,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j] > arr[j + 1]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
int n = sizeof(arr) / sizeof(arr[0]);
bubbleSort(arr, n);
cout << ""Sorted array is: \n"";
printArray(arr, n);
}
```
这段代码首先定义了一个冒泡排序函数,然后在主函数中调用这个函数并打印出排序后的数组。你可以将 `arr[]` 和 `n` 的值设置为你自己的数组或列表。
注意:这个实现是按升序排序的,如果你需要按降序排序,请使用 `sort()` 函数。"
2026-04-09 20:53:03,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j] > arr[j + 1]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
int n = sizeof(arr) / sizeof(arr[0]);
bubbleSort(arr, n);
cout << ""Sorted array is: \n"";
printArray(arr, n);
}
```
这段代码首先定义了一个冒泡排序函数,然后在主函数中调用这个函数并打印出排序后的数组。你可以将 `arr[]` 和 `n` 的值设置为你自己的数组或列表。
注意:这个实现是按升序排序的,如果你需要按降序排序,请使用 `sort()` 函数。"
2026-04-09 20:53:04,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:53:06,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was trained on a large corpus of text data to understand human speech and respond appropriately. My purpose is to assist users in finding information, answer questions, and provide helpful responses to their inquiries. Is there anything specific you would like me to help you with?"
2026-04-09 20:53:06,deepseek,Result only: 2 + 2 = ?,The result of 2 + 2 is 4.
2026-04-09 20:53:12,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j + 1] < arr[j]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
bubbleSort(arr, sizeof(arr) / sizeof(int));
printArray(arr, sizeof(arr) / sizeof(int));
return 0;
}
```
这段代码首先定义了一个函数 `bubbleSort`,它接受一个整数数组和它的大小。然后调用这个函数对数组进行排序,并打印排序后的结果。
当你运行这段代码时,你会看到以下输出:
```
21
59
37
42
86
```
这表明排序成功地完成了。注意,这里使用了 `bubbleSort` 函数来实现冒泡排序,而不是使用 `sort()` 方法。"
2026-04-09 20:53:13,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:53:18,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j + 1] < arr[j]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
bubbleSort(arr, sizeof(arr) / sizeof(int));
printArray(arr, sizeof(arr) / sizeof(int));
return 0;
}
```
这段代码首先定义了一个函数 `bubbleSort`,它接受一个整数数组和它的大小。然后调用这个函数对数组进行排序,并打印排序后的结果。
当你运行这段代码时,你会看到以下输出:
```
21
59
37
42
86
```
这表明排序成功地完成了。注意,这里使用了 `bubbleSort` 函数来实现冒泡排序,而不是使用 `sort()` 方法。"
2026-04-09 20:53:19,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:53:20,deepseek,Result only: 2 + 2 = ?,"I am a program that was created by Alibaba Cloud. I was trained on large amounts of text data to understand natural language.
My purpose is to assist users in understanding the meaning of words and phrases, as well as providing information about various topics. I can answer questions on many different subjects such as science, history, culture, etc."
2026-04-09 20:53:22,deepseek,Result only: 2 + 2 = ?,"I am a program that was created by Alibaba Cloud. I was trained on large amounts of text data to understand natural language.
My purpose is to assist users in understanding the meaning of words and phrases, as well as providing information about various topics. I can answer questions on many different subjects such as science, history, culture, etc."
2026-04-09 20:54:50,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:54:52,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was trained on a large corpus of text data to understand human speech and respond appropriately. My purpose is to assist users in finding information, answer questions, and provide helpful responses to their inquiries. Is there anything specific you would like me to help you with?"
2026-04-09 20:54:52,deepseek,Result only: 2 + 2 = ?,The result of 2 + 2 is 4.
2026-04-09 20:54:53,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!"
2026-04-09 20:54:54,deepseek,who are you?,"As an AI language model, I don't have personal characteristics or emotions. However, I was trained on a large corpus of text data to understand human speech and respond appropriately. My purpose is to assist users in finding information, answer questions, and provide helpful responses to their inquiries. Is there anything specific you would like me to help you with?"
2026-04-09 20:55:00,deepseek,用C++写冒泡排序,"当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j + 1] < arr[j]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << "" "";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
bubbleSort(arr, sizeof(arr) / sizeof(int));
printArray(arr, sizeof(arr) / sizeof(int));
return 0;
}
```
这段代码首先定义了一个函数 `bubbleSort`,它接受一个整数数组和它的大小。然后调用这个函数对数组进行排序,并打印排序后的结果。
当你运行这段代码时,你会看到以下输出:
```
21
59
37
42
86
```
这表明排序成功地完成了。注意,这里使用了 `bubbleSort` 函数来实现冒泡排序,而不是使用 `sort()` 方法。"
@@ -0,0 +1,56 @@
timestamp,model,prompt_tokens,completion_tokens,memory_usage,Decode_TPS,TTFT,Prefill_TPS,Power
2026-04-09 20:45:22,deepseek,0,0,0.00,23.91,6825.40,4.92,0.0
2026-04-09 20:51:29,deepseek,0,0,0.00,59.74,992.52,135.36,0.0
2026-04-09 20:51:30,deepseek,0,0,0.00,68.42,280.02,166.64,0.0
2026-04-09 20:51:31,deepseek,0,0,0.00,61.29,968.68,102.74,0.0
2026-04-09 20:51:32,deepseek,0,0,0.00,58.27,1185.11,55.38,0.0
2026-04-09 20:51:33,deepseek,0,0,0.00,58.86,1173.51,54.70,0.0
2026-04-09 20:51:39,deepseek,0,0,0.00,59.75,5444.75,134.78,0.0
2026-04-09 20:51:44,deepseek,0,0,0.00,58.33,5195.43,56.47,0.0
2026-04-09 20:51:49,deepseek,0,0,0.00,58.48,5182.05,55.88,0.0
2026-04-09 20:51:50,deepseek,0,0,0.00,59.30,998.41,102.51,0.0
2026-04-09 20:51:50,deepseek,0,0,0.00,67.88,281.08,167.49,0.0
2026-04-09 20:51:51,deepseek,0,0,0.00,59.00,1003.37,102.08,0.0
2026-04-09 20:51:52,deepseek,0,0,0.00,60.20,1179.14,61.43,0.0
2026-04-09 20:51:54,deepseek,0,0,0.00,58.57,1452.12,55.78,0.0
2026-04-09 20:51:59,deepseek,0,0,0.00,59.20,5494.71,134.54,0.0
2026-04-09 20:52:05,deepseek,0,0,0.00,59.09,5128.28,56.06,0.0
2026-04-09 20:52:06,deepseek,0,0,0.00,59.89,989.41,102.55,0.0
2026-04-09 20:52:11,deepseek,0,0,0.00,58.91,5521.71,134.37,0.0
2026-04-09 20:52:11,deepseek,0,0,0.00,68.55,279.02,167.79,0.0
2026-04-09 20:52:12,deepseek,0,0,0.00,59.41,996.76,102.55,0.0
2026-04-09 20:52:14,deepseek,0,0,0.00,58.96,1203.77,60.64,0.0
2026-04-09 20:52:15,deepseek,0,0,0.00,59.56,1428.35,55.30,0.0
2026-04-09 20:52:16,deepseek,0,0,0.00,60.37,982.14,102.67,0.0
2026-04-09 20:52:16,deepseek,0,0,0.00,64.42,291.03,168.09,0.0
2026-04-09 20:52:17,deepseek,0,0,0.00,60.28,983.46,102.65,0.0
2026-04-09 20:52:23,deepseek,0,0,0.00,58.94,5518.77,134.08,0.0
2026-04-09 20:52:28,deepseek,0,0,0.00,58.40,5189.08,56.20,0.0
2026-04-09 20:52:32,deepseek,0,0,0.00,60.69,4252.66,55.44,0.0
2026-04-09 20:52:37,deepseek,0,0,0.00,60.73,4250.03,55.34,0.0
2026-04-09 20:52:38,deepseek,0,0,0.00,59.74,991.43,102.86,0.0
2026-04-09 20:52:39,deepseek,0,0,0.00,59.41,1194.67,60.75,0.0
2026-04-09 20:52:39,deepseek,0,0,0.00,67.50,282.35,167.13,0.0
2026-04-09 20:52:39,deepseek,0,0,0.00,68.31,208.95,53.67,0.0
2026-04-09 20:52:40,deepseek,0,0,0.00,59.73,991.69,102.68,0.0
2026-04-09 20:52:41,deepseek,0,0,0.00,57.97,1191.25,54.97,0.0
2026-04-09 20:52:43,deepseek,0,0,0.00,58.64,1177.89,54.49,0.0
2026-04-09 20:52:48,deepseek,0,0,0.00,58.84,5529.13,132.03,0.0
2026-04-09 20:52:53,deepseek,0,0,0.00,59.30,5111.05,55.32,0.0
2026-04-09 20:52:58,deepseek,0,0,0.00,59.84,5064.89,55.70,0.0
2026-04-09 20:53:03,deepseek,0,0,0.00,59.32,5108.60,56.92,0.0
2026-04-09 20:53:04,deepseek,0,0,0.00,59.50,995.28,102.62,0.0
2026-04-09 20:53:06,deepseek,0,0,0.00,59.00,1202.87,60.73,0.0
2026-04-09 20:53:06,deepseek,0,0,0.00,66.86,283.58,168.29,0.0
2026-04-09 20:53:12,deepseek,0,0,0.00,58.23,5584.67,134.29,0.0
2026-04-09 20:53:13,deepseek,0,0,0.00,59.57,996.59,99.92,0.0
2026-04-09 20:53:18,deepseek,0,0,0.00,58.22,5588.45,130.54,0.0
2026-04-09 20:53:19,deepseek,0,0,0.00,59.45,996.10,102.61,0.0
2026-04-09 20:53:20,deepseek,0,0,0.00,58.73,1175.90,55.09,0.0
2026-04-09 20:53:22,deepseek,0,0,0.00,57.73,1196.31,54.57,0.0
2026-04-09 20:54:50,deepseek,0,0,0.00,59.82,991.33,135.35,0.0
2026-04-09 20:54:52,deepseek,0,0,0.00,58.50,1212.90,61.50,0.0
2026-04-09 20:54:52,deepseek,0,0,0.00,67.32,282.36,168.05,0.0
2026-04-09 20:54:53,deepseek,0,0,0.00,60.54,979.87,102.39,0.0
2026-04-09 20:54:54,deepseek,0,0,0.00,60.26,1177.81,61.65,0.0
2026-04-09 20:55:00,deepseek,0,0,0.00,58.50,5559.24,134.86,0.0
@@ -0,0 +1,148 @@
=== Starting llama-server test ===
filename: test_case_short.json
version: 1.0
find 3 test cases
✔ llama-server is ready (attempt 1/10)
=== Round 1 start: 3 samples (with replacement) ===
[Round 1 | Progress: 1/3]
Prompt:
who are you?
Response(stream):
[ANSWER] As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!
================================================================================
[Round 1 | 1/3]
prompt_tokens=0, completion_tokens=0, decode_tps=59.82, ttft=991.33 ms, prefill_tps=135.35
================================================================================
[Round 1 | Progress: 2/3]
Prompt:
who are you?
Response(stream):
[ANSWER] As an AI language model, I don't have personal characteristics or emotions. However, I was trained on a large corpus of text data to understand human speech and respond appropriately. My purpose is to assist users in finding information, answer questions, and provide helpful responses to their inquiries. Is there anything specific you would like me to help you with?
================================================================================
[Round 1 | 2/3]
prompt_tokens=0, completion_tokens=0, decode_tps=58.50, ttft=1212.90 ms, prefill_tps=61.50
================================================================================
[Round 1 | Progress: 3/3]
Prompt:
Result only: 2 + 2 = ?
Response(stream):
[ANSWER] The result of 2 + 2 is 4.
================================================================================
[Round 1 | 3/3]
prompt_tokens=0, completion_tokens=0, decode_tps=67.32, ttft=282.36 ms, prefill_tps=168.05
================================================================================
=== Round 1 done: 3/3 success ===
=== Round 2 start: 3 samples (with replacement) ===
[Round 2 | Progress: 1/3]
Prompt:
who are you?
Response(stream):
[ANSWER] As an AI language model, I don't have personal characteristics or emotions. However, I was created by Alibaba Cloud to assist with various tasks such as understanding human speech and providing information on different subjects. If you need help with something specific, feel free to ask!
================================================================================
[Round 2 | 1/3]
prompt_tokens=0, completion_tokens=0, decode_tps=60.54, ttft=979.87 ms, prefill_tps=102.39
================================================================================
[Round 2 | Progress: 2/3]
Prompt:
who are you?
Response(stream):
[ANSWER] As an AI language model, I don't have personal characteristics or emotions. However, I was trained on a large corpus of text data to understand human speech and respond appropriately. My purpose is to assist users in finding information, answer questions, and provide helpful responses to their inquiries. Is there anything specific you would like me to help you with?
================================================================================
[Round 2 | 2/3]
prompt_tokens=0, completion_tokens=0, decode_tps=60.26, ttft=1177.81 ms, prefill_tps=61.65
================================================================================
[Round 2 | Progress: 3/3]
Prompt:
用C++写冒泡排序
Response(stream):
[ANSWER] 当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j + 1] < arr[j]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
cout << arr[i] << " ";
}
}
int main() {
int arr[] = {42, 86, 37, 59, 21};
bubbleSort(arr, sizeof(arr) / sizeof(int));
printArray(arr, sizeof(arr) / sizeof(int));
return 0;
}
```
这段代码首先定义了一个函数 `bubbleSort`,它接受一个整数数组和它的大小。然后调用这个函数对数组进行排序,并打印排序后的结果。
当你运行这段代码时,你会看到以下输出:
```
21
59
37
42
86
```
这表明排序成功地完成了。注意,这里使用了 `bubbleSort` 函数来实现冒泡排序,而不是使用 `sort()` 方法。
================================================================================
[Round 2 | 3/3]
prompt_tokens=0, completion_tokens=0, decode_tps=58.50, ttft=5559.24 ms, prefill_tps=134.86
================================================================================
=== Round 2 done: 3/3 success ===
=== Round 3 start: 3 samples (with replacement) ===
[Round 3 | Progress: 1/3]
Prompt:
用C++写冒泡排序
Response(stream):
[ANSWER] 当然!以下是一个简单的C++实现冒泡排序:
```cpp
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
bool swapped = false;
for (int j = 0; j < n - i - 1 && !swapped; j++) {
if (arr[j] > arr[j + 1]) {
swapped = true;
swap(arr[j], arr[j + 1]);
}
}
}
}
void printArray(int arr[], int size)
@@ -0,0 +1,90 @@
#include <vector>
#include <iostream>
#include <iomanip> // 用于格式化输出
using namespace std;
int main() {
// --------------------- 1. 初始化输入图像 ---------------------
// 假设输入图像形状为 [3, 896, 896](通道优先:C×H×W
const int C = 3; // 通道数(RGB
const int H = 896; // 图像高度
const int W = 896; // 图像宽度
vector<float> inp_raw(C * H * W, 1.0f); // 示例:全1数据(实际需替换为真实图像数据)
// --------------------- 2. 分块参数计算 ---------------------
const int num_patches_h = 14; // Height方向分块数
const int num_patches_w = 14; // Width方向分块数
const int patch_h = H / num_patches_h; // 单个Patch的高度(64
const int patch_w = W / num_patches_w; // 单个Patch的宽度(64
// --------------------- 3. 提取每个Patch的统计特征(示例:均值) ---------------------
// patch_means[ph][pw][c] 存储第ph行、第pw列Patch的第c通道均值
vector<vector<vector<float>>> patch_means(
num_patches_h,
vector<vector<float>>(num_patches_w, vector<float>(C))
);
for (int c = 0; c < C; ++c) {
for (int ph = 0; ph < num_patches_h; ++ph) {
for (int pw = 0; pw < num_patches_w; ++pw) {
float sum = 0.0f;
int count = 0;
// 遍历Patch内所有像素
for (int h = ph * patch_h; h < (ph + 1) * patch_h; ++h) {
for (int w = pw * patch_w; w < (pw + 1) * patch_w; ++w) {
int idx = c * H * W + h * W + w; // 计算inp_raw中像素的索引
sum += inp_raw[idx];
count++;
}
}
patch_means[ph][pw][c] = sum / count; // 计算该Patch的通道均值
}
}
}
// --------------------- 4. 构建目标维度:4096×2×3×14×14 ---------------------
const int batch_size = 4096; // Batch大小
const int num_views = 2; // 视角/分支数(如时间步、参考帧与当前帧)
// 目标数组形状:[batch_size, num_views, C, num_patches_h, num_patches_w]
vector<float> target(
batch_size * num_views * C * num_patches_h * num_patches_w
);
// 填充目标数组:每个Batch元素、视角、通道、Patch位置均使用对应Patch的均值
for (int n = 0; n < batch_size; ++n) {
for (int m = 0; m < num_views; ++m) {
for (int c = 0; c < C; ++c) {
for (int ph = 0; ph < num_patches_h; ++ph) {
for (int pw = 0; pw < num_patches_w; ++pw) {
// 计算目标数组的一维索引
int target_idx = n * num_views * C * num_patches_h * num_patches_w
+ m * C * num_patches_h * num_patches_w
+ c * num_patches_h * num_patches_w
+ ph * num_patches_w + pw;
target[target_idx] = patch_means[ph][pw][c];
}
}
}
}
}
// --------------------- 5. 验证输出(可选) ---------------------
cout << "目标数组总元素数: " << target.size() << "(预期: "
<< batch_size * num_views * C * num_patches_h * num_patches_w << "" << endl;
// 打印第一个Batch、第一个视角、第一个通道的所有Patch值(前几个)
cout << "\n第一个Batch、第一个视角、第一个通道的Patch均值(前20个):" << endl;
for (int ph = 0; ph < min(5, num_patches_h); ++ph) { // 只打印前5个Patch的行
for (int pw = 0; pw < min(5, num_patches_w); ++pw) { // 只打印前5个Patch的列
int idx = 0 * num_views * C * num_patches_h * num_patches_w
+ 0 * C * num_patches_h * num_patches_w
+ 0 * num_patches_h * num_patches_w
+ ph * num_patches_w + pw;
cout << fixed << setprecision(2) << target[idx] << "\t";
}
cout << endl;
}
return 0;
}
@@ -0,0 +1,124 @@
#include <iostream>
#include <vector>
#include <cmath>
#include <cassert>
// 辅助函数:打印张量形状信息
void print_shape(const std::vector<int>& shape) {
std::cout << "[";
for (size_t i = 0; i < shape.size(); ++i) {
std::cout << shape[i];
if (i != shape.size() - 1) std::cout << ", ";
}
std::cout << "]" << std::endl;
}
// 核心函数:将 3x896x896 图像转换为 4096x2x3x14x14 Patches
void image_to_patches(
const float* input_data, // 输入图像指针 [3, 896, 896]
float* output_data, // 输出 patches 指针 [4096, 2, 3, 14, 14]
int img_c, int img_h, int img_w, // 输入图像维度: 3, 896, 896
int patch_h, int patch_w, // Patch 尺寸: 14, 14
int target_n, int target_t // 目标维度: 4096, 2
) {
// 计算每行的 patch 数量
int patches_per_row = img_w / patch_w; // 896 / 14 = 64
int patches_per_col = img_h / patch_h; // 896 / 14 = 64
// 校验目标 N 是否匹配
assert(patches_per_row * patches_per_col == target_n && "计算出的 Patch 总数与目标的 N=4096 不符!");
// 遍历每一个 Patch
for (int p_idx = 0; p_idx < target_n; ++p_idx) {
// 计算当前 patch 在原图上的起始坐标
int row = p_idx / patches_per_row;
int col = p_idx % patches_per_row;
int start_y = row * patch_h;
int start_x = col * patch_w;
// 遍历时间/副本维度 T (0 到 1)
for (int t = 0; t < target_t; ++t) {
// 遍历 RGB 三个通道
for (int c = 0; c < img_c; ++c) {
// 遍历 Patch 内部像素
for (int ph = 0; ph < patch_h; ++ph) {
for (int pw = 0; pw < patch_w; ++pw) {
// --- 输入索引计算 [C, H, W] ---
int in_y = start_y + ph;
int in_x = start_x + pw;
// 防止越界 (虽然这里整除刚好不会越界)
if (in_y >= img_h || in_x >= img_w) continue;
size_t input_idx = (size_t)c * img_h * img_w +
(size_t)in_y * img_w +
(size_t)in_x;
// --- 输出索引计算 [N, T, C, h, w] ---
size_t output_idx = 0;
output_idx += (size_t)p_idx * target_t * img_c * patch_h * patch_w;
output_idx += (size_t)t * img_c * patch_h * patch_w;
output_idx += (size_t)c * patch_h * patch_w;
output_idx += (size_t)ph * patch_w;
output_idx += (size_t)pw;
// 赋值
output_data[output_idx] = input_data[input_idx];
}
}
}
}
}
}
int main() {
// 1. 定义输入和输出形状
const int IMG_C = 3;
const int IMG_H = 896;
const int IMG_W = 896;
const int PATCH_H = 14;
const int PATCH_W = 14;
const int TARGET_N = 4096; // 64 * 64
const int TARGET_T = 2;
// 2. 分配内存
// 输入大小: 3 * 896 * 896 = 2,408,448
std::vector<float> input_image(IMG_C * IMG_H * IMG_W, 0.0f);
// 输出大小: 4096 * 2 * 3 * 14 * 14 = 4,825,344
// 注意:输出大小是输入的两倍,因为 T=2 维度相当于存了两份所有的 patches
std::vector<float> output_patches(TARGET_N * TARGET_T * IMG_C * PATCH_H * PATCH_W, 0.0f);
// 3. 填充一些测试数据 (例如给 R 通道赋值为 1.0)
for (int i = 0; i < IMG_H * IMG_W; ++i) {
input_image[i] = 1.0f; // R channel part (simplified indexing for init)
}
std::cout << "Input Image Shape: ";
print_shape({IMG_C, IMG_H, IMG_W});
std::cout << "Input Element Count: " << input_image.size() << std::endl;
// 4. 执行转换
image_to_patches(
input_image.data(),
output_patches.data(),
IMG_C, IMG_H, IMG_W,
PATCH_H, PATCH_W,
TARGET_N, TARGET_T
);
std::cout << "Output Patches Shape: ";
print_shape({TARGET_N, TARGET_T, IMG_C, PATCH_H, PATCH_W});
std::cout << "Output Element Count: " << output_patches.size() << std::endl;
// 5. 简单验证:检查第一个 patch 的第一个像素是否拷贝成功
// 根据我们的索引计算,output[0, 0, 0, 0, 0] 应该等于 input[0, 0, 0]
float test_val = output_patches[0];
std::cout << "Verification: output_patches[0] = " << test_val << " (Expected 1.0)" << std::endl;
return 0;
}
@@ -0,0 +1,54 @@
std::vector<float> inp_raw;
// 补充:OPENAI_CLIP的均值和标准差(来自图2,对应RGB通道)
const std::vector<float> OPENAI_CLIP_MEAN = {0.48145466f, 0.4578275f, 0.40821073f};
const std::vector<float> OPENAI_CLIP_STD = {0.26862954f, 0.26130258f, 0.27577711f};
// set input pixel values
if (!imgs.is_audio) {
size_t nelem = 0;
for (const auto & img : imgs.entries) {
nelem += img->nx * img->ny * 3; // 总元素数=图片数×宽×高×3通道
}
inp_raw.resize(nelem); // 预分配内存
for (size_t i = 0; i < imgs.entries.size(); i++) {
const int nx = imgs.entries[i]->nx; // 图像宽度
const int ny = imgs.entries[i]->ny; // 图像高度
const int n = nx * ny; // 单通道像素总数(宽×高)
for (int b = 0; b < batch_size; b++) { // 遍历批次(假设batch_size ≤ 图片数)
// 当前样本在inp_raw中的起始地址(3通道,每通道n像素)
float* batch_entry = inp_raw.data() + b * (3 * n);
for (int y = 0; y < ny; y++) { // 遍历行
for (int x = 0; x < nx; x++) { // 遍历列
// 源图像中当前像素的RGB起始索引(假设buf按RGB顺序存储)
size_t base_src = 3 * (y * nx + x);
// 目标通道内的像素索引(行优先,同原代码)
size_t base_dst = y * nx + x;
// -------------------------- 核心:缩放+标准化 --------------------------
// 1. 读取原始RGB值(假设buf为0-255的整数,转为float
float r = static_cast<float>(imgs.entries[b]->buf[base_src]); // R通道
float g = static_cast<float>(imgs.entries[b]->buf[base_src + 1]); // G通道
float b_val = static_cast<float>(imgs.entries[b]->buf[base_src + 2]); // B通道(避名)
// 2. 缩放:×1/255(归一化到0-1
r *= (1.0f / 255.0f);
g *= (1.0f / 255.0f);
b_val *= (1.0f / 255.0f);
// 3. 标准化:(x - mean) / std(使用CLIP的均值和标准差)
r = (r - OPENAI_CLIP_MEAN[0]) / OPENAI_CLIP_STD[0]; // R通道标准化
g = (g - OPENAI_CLIP_MEAN[1]) / OPENAI_CLIP_STD[1]; // G通道标准化
b_val = (b_val - OPENAI_CLIP_MEAN[2]) / OPENAI_CLIP_STD[2]; // B通道标准化
// ----------------------------------------------------------------------
// 存入batch_entry(通道顺序:R→0~n-1G→n~2n-1B→2n~3n-1,与原代码一致)
batch_entry[base_dst] = r; // R通道
batch_entry[1 * n + base_dst] = g; // G通道(1×n偏移)
batch_entry[2 * n + base_dst] = b_val; // B通道(2×n偏移)
}
}
}
}
}
@@ -0,0 +1,25 @@
commit author_date author subject original_path blob recovered_file
1f0d5bb0453f93ffa51faf68237c89251c2e0c40 2026-04-09T17:38:37+08:00 wangbomeng add --device-info calculet0_103149_run.txt 153d97e98aa350a5645e6e532a626a6c3a2c2582 calculet0_103149_run.txt--1f0d5bb0453f
1f0d5bb0453f93ffa51faf68237c89251c2e0c40 2026-04-09T17:38:37+08:00 wangbomeng add --device-info calculet0_103264_run.txt 6483ceddec9ab053c30408811ab1ea1ab4f994e2 calculet0_103264_run.txt--1f0d5bb0453f
1f0d5bb0453f93ffa51faf68237c89251c2e0c40 2026-04-09T17:38:37+08:00 wangbomeng add --device-info calculet0_103409_run.txt 93dd36245ab2d87ef6bac3a12e364d187b75e739 calculet0_103409_run.txt--1f0d5bb0453f
1f0d5bb0453f93ffa51faf68237c89251c2e0c40 2026-04-09T17:38:37+08:00 wangbomeng add --device-info calculet0_103634_run.txt 08ef62c34cc3b76ee69ef6da872a9dfce677416f calculet0_103634_run.txt--1f0d5bb0453f
aa54a7c637f2c92d924a5f35386975b1c27de898 2026-02-27T01:30:36+08:00 wangbomeng Add bf16_to_fp32 calculet0_12456_run.txt 53a62a721a90b134cf8716e63c605bdc81dbcf0a calculet0_12456_run.txt--aa54a7c637f2
aa54a7c637f2c92d924a5f35386975b1c27de898 2026-02-27T01:30:36+08:00 wangbomeng Add bf16_to_fp32 calculet0_7518_run.txt f6fbf904abe4e169256125cb55108011867b14d3 calculet0_7518_run.txt--aa54a7c637f2
96b4e267e562f44e76ec6c965ee0fa361f0439bf 2026-04-17T15:33:01+08:00 wangbomeng merge dev-ot calculet0_141241_run.txt 4041e6c79f47735912d13065a9d25f1769c40a31 calculet0_141241_run.txt--96b4e267e562
96b4e267e562f44e76ec6c965ee0fa361f0439bf 2026-04-17T15:33:01+08:00 wangbomeng merge dev-ot calculet0_141410_run.txt 3cbcee285c6767e4ee5d5157d8b089f9461b4429 calculet0_141410_run.txt--96b4e267e562
82842cfc3fa3d5c004c4540aeff8a81f38509bee 2026-04-09T15:06:26+08:00 wangbomeng server: fix limit tokens to max_seq_len calculet0_17323_run.txt 1972792c0d6ccb12cdfcc15d0a89b97a8a267bc6 calculet0_17323_run.txt--82842cfc3fa3
b6f29ec8140028619efaa50aa6e73146cecf631d 2026-04-13T11:23:31+08:00 wangbomeng server: fix context-shift calculet0_353163_run.txt 07d78dec4e31d5e3991a5b177c2ab20d65b10c82 calculet0_353163_run.txt--b6f29ec81400
b6f29ec8140028619efaa50aa6e73146cecf631d 2026-04-13T11:23:31+08:00 wangbomeng server: fix context-shift calculet0_353335_run.txt 0ae27da7d33585241abbb0887fc996924900be9b calculet0_353335_run.txt--b6f29ec81400
b6f29ec8140028619efaa50aa6e73146cecf631d 2026-04-13T11:23:31+08:00 wangbomeng server: fix context-shift calculet0_354076_run.txt 967ff2a3b2c001408a7c656cff31285a50caea1f calculet0_354076_run.txt--b6f29ec81400
b6f29ec8140028619efaa50aa6e73146cecf631d 2026-04-13T11:23:31+08:00 wangbomeng server: fix context-shift calculet0_354399_run.txt 499d1d40ed576135de276c6ec7633b706f00b23c calculet0_354399_run.txt--b6f29ec81400
b6f29ec8140028619efaa50aa6e73146cecf631d 2026-04-13T11:23:31+08:00 wangbomeng server: fix context-shift calculet0_354593_run.txt fe58a1e2f9f394f7ca3cf345525015b8ae78c934 calculet0_354593_run.txt--b6f29ec81400
7800c772d44a7415640ec1669a691232939927cf 2026-05-13T15:23:54+08:00 wangbomeng try passkey and embedding calculet0_6145_run.txt 3f01e318dd0c5f149b28fb5208b61d562171cb21 calculet0_6145_run.txt--7800c772d44a
7800c772d44a7415640ec1669a691232939927cf 2026-05-13T15:23:54+08:00 wangbomeng try passkey and embedding calculet0_6728_run.txt 41b92eb616c878a624ca8becec9b31a5b4a55598 calculet0_6728_run.txt--7800c772d44a
7800c772d44a7415640ec1669a691232939927cf 2026-05-13T15:23:54+08:00 wangbomeng try passkey and embedding calculet0_7810_run.txt fd06c70f0f31126e830e1e8ea87d6293aa8a1008 calculet0_7810_run.txt--7800c772d44a
af8055f5f033a730e7e1fe80185b18b7e9473966 2026-04-10T14:58:19+08:00 wangbomeng add annotations llama_content_logs.csv 2678215008d62e9f675cd50602bf6bbfbc13bc2a llama_content_logs.csv--af8055f5f033
af8055f5f033a730e7e1fe80185b18b7e9473966 2026-04-10T14:58:19+08:00 wangbomeng add annotations llama_perf_logs.csv 16550f041a99c3e40d0a9142a3b9e5fe195b0d25 llama_perf_logs.csv--af8055f5f033
af8055f5f033a730e7e1fe80185b18b7e9473966 2026-04-10T14:58:19+08:00 wangbomeng add annotations log.1 490d2f80e290ff8accd02254a0f0e2e34fcb801c log.1--af8055f5f033
005112c51e00d998b457337ca3dad53fc46e2d0b 2026-04-24T16:24:31+08:00 wangbomeng clip: add image_to_patches; calrt: vision copy data from bf16 to fp32 patch1.cpp b0a73d9ae2679bd2ea840730375fc6d4b4c71c67 patch1.cpp--005112c51e00
005112c51e00d998b457337ca3dad53fc46e2d0b 2026-04-24T16:24:31+08:00 wangbomeng clip: add image_to_patches; calrt: vision copy data from bf16 to fp32 patch2.cpp de563ce2bc5072c1a6d470f2977cc31cad5b4ce1 patch2.cpp--005112c51e00
005112c51e00d998b457337ca3dad53fc46e2d0b 2026-04-24T16:24:31+08:00 wangbomeng clip: add image_to_patches; calrt: vision copy data from bf16 to fp32 patch3.cpp 811336a8abe5d07b117a8b023c0ad0a883e080ee patch3.cpp--005112c51e00
6d5e83902bdd3142a8ff0d3db19f02a8619e95a0 2026-03-27T00:57:11+08:00 wangbomeng server: printf calrt commit ID server_old.cpp f3b335e70e6453cd35ea056f503d7204292363d8 server_old.cpp--6d5e83902bdd
1 commit author_date author subject original_path blob recovered_file
2 1f0d5bb0453f93ffa51faf68237c89251c2e0c40 2026-04-09T17:38:37+08:00 wangbomeng add --device-info calculet0_103149_run.txt 153d97e98aa350a5645e6e532a626a6c3a2c2582 calculet0_103149_run.txt--1f0d5bb0453f
3 1f0d5bb0453f93ffa51faf68237c89251c2e0c40 2026-04-09T17:38:37+08:00 wangbomeng add --device-info calculet0_103264_run.txt 6483ceddec9ab053c30408811ab1ea1ab4f994e2 calculet0_103264_run.txt--1f0d5bb0453f
4 1f0d5bb0453f93ffa51faf68237c89251c2e0c40 2026-04-09T17:38:37+08:00 wangbomeng add --device-info calculet0_103409_run.txt 93dd36245ab2d87ef6bac3a12e364d187b75e739 calculet0_103409_run.txt--1f0d5bb0453f
5 1f0d5bb0453f93ffa51faf68237c89251c2e0c40 2026-04-09T17:38:37+08:00 wangbomeng add --device-info calculet0_103634_run.txt 08ef62c34cc3b76ee69ef6da872a9dfce677416f calculet0_103634_run.txt--1f0d5bb0453f
6 aa54a7c637f2c92d924a5f35386975b1c27de898 2026-02-27T01:30:36+08:00 wangbomeng Add bf16_to_fp32 calculet0_12456_run.txt 53a62a721a90b134cf8716e63c605bdc81dbcf0a calculet0_12456_run.txt--aa54a7c637f2
7 aa54a7c637f2c92d924a5f35386975b1c27de898 2026-02-27T01:30:36+08:00 wangbomeng Add bf16_to_fp32 calculet0_7518_run.txt f6fbf904abe4e169256125cb55108011867b14d3 calculet0_7518_run.txt--aa54a7c637f2
8 96b4e267e562f44e76ec6c965ee0fa361f0439bf 2026-04-17T15:33:01+08:00 wangbomeng merge dev-ot calculet0_141241_run.txt 4041e6c79f47735912d13065a9d25f1769c40a31 calculet0_141241_run.txt--96b4e267e562
9 96b4e267e562f44e76ec6c965ee0fa361f0439bf 2026-04-17T15:33:01+08:00 wangbomeng merge dev-ot calculet0_141410_run.txt 3cbcee285c6767e4ee5d5157d8b089f9461b4429 calculet0_141410_run.txt--96b4e267e562
10 82842cfc3fa3d5c004c4540aeff8a81f38509bee 2026-04-09T15:06:26+08:00 wangbomeng server: fix limit tokens to max_seq_len calculet0_17323_run.txt 1972792c0d6ccb12cdfcc15d0a89b97a8a267bc6 calculet0_17323_run.txt--82842cfc3fa3
11 b6f29ec8140028619efaa50aa6e73146cecf631d 2026-04-13T11:23:31+08:00 wangbomeng server: fix context-shift calculet0_353163_run.txt 07d78dec4e31d5e3991a5b177c2ab20d65b10c82 calculet0_353163_run.txt--b6f29ec81400
12 b6f29ec8140028619efaa50aa6e73146cecf631d 2026-04-13T11:23:31+08:00 wangbomeng server: fix context-shift calculet0_353335_run.txt 0ae27da7d33585241abbb0887fc996924900be9b calculet0_353335_run.txt--b6f29ec81400
13 b6f29ec8140028619efaa50aa6e73146cecf631d 2026-04-13T11:23:31+08:00 wangbomeng server: fix context-shift calculet0_354076_run.txt 967ff2a3b2c001408a7c656cff31285a50caea1f calculet0_354076_run.txt--b6f29ec81400
14 b6f29ec8140028619efaa50aa6e73146cecf631d 2026-04-13T11:23:31+08:00 wangbomeng server: fix context-shift calculet0_354399_run.txt 499d1d40ed576135de276c6ec7633b706f00b23c calculet0_354399_run.txt--b6f29ec81400
15 b6f29ec8140028619efaa50aa6e73146cecf631d 2026-04-13T11:23:31+08:00 wangbomeng server: fix context-shift calculet0_354593_run.txt fe58a1e2f9f394f7ca3cf345525015b8ae78c934 calculet0_354593_run.txt--b6f29ec81400
16 7800c772d44a7415640ec1669a691232939927cf 2026-05-13T15:23:54+08:00 wangbomeng try passkey and embedding calculet0_6145_run.txt 3f01e318dd0c5f149b28fb5208b61d562171cb21 calculet0_6145_run.txt--7800c772d44a
17 7800c772d44a7415640ec1669a691232939927cf 2026-05-13T15:23:54+08:00 wangbomeng try passkey and embedding calculet0_6728_run.txt 41b92eb616c878a624ca8becec9b31a5b4a55598 calculet0_6728_run.txt--7800c772d44a
18 7800c772d44a7415640ec1669a691232939927cf 2026-05-13T15:23:54+08:00 wangbomeng try passkey and embedding calculet0_7810_run.txt fd06c70f0f31126e830e1e8ea87d6293aa8a1008 calculet0_7810_run.txt--7800c772d44a
19 af8055f5f033a730e7e1fe80185b18b7e9473966 2026-04-10T14:58:19+08:00 wangbomeng add annotations llama_content_logs.csv 2678215008d62e9f675cd50602bf6bbfbc13bc2a llama_content_logs.csv--af8055f5f033
20 af8055f5f033a730e7e1fe80185b18b7e9473966 2026-04-10T14:58:19+08:00 wangbomeng add annotations llama_perf_logs.csv 16550f041a99c3e40d0a9142a3b9e5fe195b0d25 llama_perf_logs.csv--af8055f5f033
21 af8055f5f033a730e7e1fe80185b18b7e9473966 2026-04-10T14:58:19+08:00 wangbomeng add annotations log.1 490d2f80e290ff8accd02254a0f0e2e34fcb801c log.1--af8055f5f033
22 005112c51e00d998b457337ca3dad53fc46e2d0b 2026-04-24T16:24:31+08:00 wangbomeng clip: add image_to_patches; calrt: vision copy data from bf16 to fp32 patch1.cpp b0a73d9ae2679bd2ea840730375fc6d4b4c71c67 patch1.cpp--005112c51e00
23 005112c51e00d998b457337ca3dad53fc46e2d0b 2026-04-24T16:24:31+08:00 wangbomeng clip: add image_to_patches; calrt: vision copy data from bf16 to fp32 patch2.cpp de563ce2bc5072c1a6d470f2977cc31cad5b4ce1 patch2.cpp--005112c51e00
24 005112c51e00d998b457337ca3dad53fc46e2d0b 2026-04-24T16:24:31+08:00 wangbomeng clip: add image_to_patches; calrt: vision copy data from bf16 to fp32 patch3.cpp 811336a8abe5d07b117a8b023c0ad0a883e080ee patch3.cpp--005112c51e00
25 6d5e83902bdd3142a8ff0d3db19f02a8619e95a0 2026-03-27T00:57:11+08:00 wangbomeng server: printf calrt commit ID server_old.cpp f3b335e70e6453cd35ea056f503d7204292363d8 server_old.cpp--6d5e83902bdd