The two are legally separate. The employer's obligation to cancel the work permit (within 10 working days of the employment ending) is a statutory duty it cannot condition on you waiving compensation. Signing a 'waive compensation for cancellation' clause risks giving up a right for something the employer must do anyway.
Nationwide (all cities)
Cancellation is an independent statutory duty
The cancellation duty is independent of compensation. Section 7 of the Service Guide on Work Permits for Foreigners in China (Interim) requires the employer to apply for cancellation within 10 working days of the employment ending; where the employer is terminated (e.g. it is dissolved or its license revoked), the applicant may apply for cancellation themselves. The Shanghai guide and the Guangzhou guide repeat this. This is a statutory obligation that arises the moment the employment ends, regardless of any compensation negotiation.
Compensation is a separate right
Compensation, by contrast, is a separate right. Under Article 46 of the Labor Contract Law, it is owed in the employer-initiated situations (and, in Shanghai, only where the contract provides for it). There is no legal link between the two: the employer cannot lawfully refuse to cancel the work permit because you will not waive compensation.
The practical trap
Practical risk: employers sometimes present the cancellation as a bargaining chip, asking you to sign a clause waiving compensation 'in exchange for' the cancellation they must perform anyway. If you are otherwise entitled to compensation, signing such a clause gives up a real right for no additional consideration. The safer course is to keep the two tracks separate: insist on cancellation as a matter of course, and handle compensation (if any) on its own merits.