分页: 1 / 1

#1 我老非常确定deepseek是用老gpt 4刷出来的,因为我问了4o半年曾经答错的问题

发表于 : 2025年 1月 26日 14:48
赖美豪中
deepseek犯了一个一摸一样的错误,然后4o现在已经纠正过了,我贴出来给大家看看
In C, the size of a struct is not always simply the sum of the sizes of its individual members due to padding and alignment requirements imposed by the compiler. These requirements ensure that data is stored in memory in a way that is efficient for the CPU to access. To calculate the size of a struct, you need to consider both the sizes of its members and the alignment rules.

Here’s how you can calculate the size of a struct that includes int8_t, float, double, and complex (assuming complex is a double complex type from <complex.h>):

Example Struct:
c
Copy
#include <stdint.h>
#include <complex.h>

struct Example {
int8_t a; // 1 byte
float b; // 4 bytes
double c; // 8 bytes
double complex d; // Typically 16 bytes (2 doubles)
};
Step-by-Step Calculation:
Understand the Sizes of Each Member:

int8_t a: 1 byte

float b: 4 bytes

double c: 8 bytes

double complex d: Typically 16 bytes (2 doubles, 8 bytes each)

Understand Alignment Rules:

The alignment of a struct is determined by the largest member.

Common alignment rules:

int8_t: 1-byte alignment

float: 4-byte alignment

double: 8-byte alignment

double complex: 8-byte alignment (since it consists of two double values)

Calculate the Layout with Padding:

Start with int8_t a (1 byte).

Next is float b (4 bytes). It needs 4-byte alignment, so the compiler adds 3 bytes of padding after a to align b.

Next is double c (8 bytes). It needs 8-byte alignment, so the compiler adds 4 bytes of padding after b to align c.

Finally, double complex d (16 bytes). It needs 8-byte alignment, and since c is already 8-byte aligned, no padding is needed before d.

Sum the Sizes:

a: 1 byte

Padding after a: 3 bytes

b: 4 bytes

Padding after b: 4 bytes

c: 8 bytes

d: 16 bytes

Total size = 1 + 3 + 4 + 4 + 8 + 16 = 36 bytes

Verification Using sizeof:
You can verify this calculation using the sizeof operator in C:

c
Copy
#include <stdio.h>
#include <stdint.h>
#include <complex.h>

struct Example {
int8_t a;
float b;
double c;
double complex d;
};

int main() {
printf("Size of struct Example: %zu bytes\n", sizeof(struct Example));
return 0;
}
Output:

Copy
Size of struct Example: 36 bytes
Key Points:
Padding: The compiler adds padding to ensure proper alignment of each member.

Alignment: The alignment of the struct is determined by its largest member.

Order Matters: The size of the struct can change if you reorder the members. For example, placing the largest member first can reduce padding.

If you reorder the members to minimize padding, the size might change. For example:

c
Copy
struct ExampleOptimized {
double c; // 8 bytes
double complex d; // 16 bytes
float b; // 4 bytes
int8_t a; // 1 byte
};
This reordering might reduce the total size by minimizing padding. You can use sizeof to check the new size.

Let me know if you need further clarification!

#2 Re: 我老非常确定deepseek是用老gpt 4刷出来的,因为我问了4o半年曾经答错的问题

发表于 : 2025年 1月 26日 15:59
HouseMD
你知道什么叫蒸馏吗

#3 Re: 我老非常确定deepseek是用老gpt 4刷出来的,因为我问了4o半年曾经答错的问题

发表于 : 2025年 1月 27日 09:22
赖美豪中
蒸馏是用自己的模型蒸馏,用别人的那就剽窃,大哥
HouseMD 写了: 2025年 1月 26日 15:59 你知道什么叫蒸馏吗

#4 Re: 我老非常确定deepseek是用老gpt 4刷出来的,因为我问了4o半年曾经答错的问题

发表于 : 2025年 1月 27日 09:24
ferrygao
赖美豪中 写了: 2025年 1月 27日 09:22 蒸馏是用自己的模型蒸馏,用别人的那就剽窃,大哥
什么别人的自己的 都是我的

#5 Re: 我老非常确定deepseek是用老gpt 4刷出来的,因为我问了4o半年曾经答错的问题

发表于 : 2025年 1月 27日 09:28
fuqiang
从土工自己公布的来说,就是meta开源模型上改进,版权肯定是违法。当然对nvda是短期利空,因为大家也会用局部改进方法降低算力成本。

#6 Re: 我老非常确定deepseek是用老gpt 4刷出来的,因为我问了4o半年曾经答错的问题

发表于 : 2025年 1月 27日 09:30
Cellcycle2
fuqiang 写了: 2025年 1月 27日 09:28 从土工自己公布的来说,就是meta开源模型上改进,版权肯定是违法。当然对nvda是短期利空,因为大家也会用局部改进方法降低算力成本。
弯道超车??

#7 Re: 我老非常确定deepseek是用老gpt 4刷出来的,因为我问了4o半年曾经答错的问题

发表于 : 2025年 1月 27日 09:36
IsItTrue
原来还看到回答里面直接说到类似我是chatgpt之类。不过现在蒸馏版权问题,没啥定论吧,用了你也没办法。

#8 Re: 我老非常确定deepseek是用老gpt 4刷出来的,因为我问了4o半年曾经答错的问题

发表于 : 2025年 1月 27日 10:27
macarthur
IsItTrue 写了: 2025年 1月 27日 09:36 原来还看到回答里面直接说到类似我是chatgpt之类。不过现在蒸馏版权问题,没啥定论吧,用了你也没办法。
笑翻了。。。 可怜一帮小粉儿还乐滋滋地庆祝弯道超车

图片

#9 Re: 我老非常确定deepseek是用老gpt 4刷出来的,因为我问了4o半年曾经答错的问题

发表于 : 2025年 1月 27日 14:12
irisyuan
这种东西就别来这个版刷了吧。菌斑术版STEM都可以

#10 Re: 我老非常确定deepseek是用老gpt 4刷出来的,因为我问了4o半年曾经答错的问题

发表于 : 2025年 1月 27日 14:17
StMichael
具体怎么做到? V3 有630B 参数,怎么用gpt 4刷?

#11 Re: 我老非常确定deepseek是用老gpt 4刷出来的,因为我问了4o半年曾经答错的问题

发表于 : 2025年 1月 28日 01:28
absdjk123
同意,我有gpt付费版,今天问了个问题。ds给的例子跟gpt都一样。一模一样。